Map configuration

MAP is a module to generate a geodata viewer with view, annotate, search and query capabilities based on OGC services (WMS, WFS, WPS...).

EasySDI Map Geodata viewer can be deliveres as Geoext or as Leaflet.

Geoext Map is built on several javascript libraries :

- OpenLayers http://openlayers.org/
- ExtJS http://www.sencha.com/products/extjs
- GeoExt http://www.geoext.org/
- OpenGeo Suite SDK http://opengeo.org/technology/sdk/

The purpose of using this libraries combination is to give the best user experience.

As EasySDI Map is a Joomla! component, the administration section is a standard Joomla! back-end site.
The main purpose of the administration section is to define contexts.

A context consists of the contents (geoservices and layers) and of the tools available in the geodata viewer.
A context, and all of its constituting elements, are subject to access level restrictions.

With the combination of context definition and access level restrictions, you can build a powerfull geodata viewer with a very fine-tune user access management.

Component options


Proxyhost

As the component Map is a javascript base viewer consuming remote OGC web services, you have to handle the same origin policy in your system configuration to avoid crossdomain restrictions.

Two ways to configure your system :

  • Use a ProxyHost
    EasySDI provide a proxy php by default that is used if nothing is filled in this field

This solution is not recommanded due to security holes that this script introduces into EasySDI solution.
To handle same origin policy and assure remote web services security access, we do recommand to use the EasySDI Proxy combined with a web server proxy/gateway extension, like apache proxy_module.

Apache configuration
Let's explained by the example :

You are hosting your Joomla site at the following address : www.my-easysdi.com.
And having your EasySDI Proxy servlet at this one : www.proxy-easysdi:8080/proxy.
In order to access your proxied services into the map viewer, the two have to be in the same domain, so define www.my-easysdi.com/proxy as EasySDI Proxy URL would be the solution.
To do that :
1/ Enable proxy_module : open the Apache configuration file [Apache root]/conf/httpd.conf, remove '#' character in front of, or add the all following line

LoadModule proxy_module modules/mod_proxy.so

2/ Define your reverse proxy at the end of the configuration file :

ProxyPass /proxy www.proxy-easysdi:8080/proxy
ProxyPassReverse /proxy www.proxy-easysdi:8080/proxy

With this configuration, the map viewer makes requests for content in the name-spaced of the reverse proxy. The reverse proxy then sends those requests to the actual Proxy location and returns the content as if it was itself the origin.

Proxy Service configuration
The Map viewer sends GetCapabilities requests on the remote services added to the map to retreive for each available operation the URL to query.
With the use of the Apache module_proxy, those URL won't be overwritten with the reverse proxy URL (eg : www.my-easysdi.com/proxy) (this is not the purpose of this module) and will expose URL of the original location (eg : www.proxy-easysdi:8080/proxy). The following map requests for those operations will failed due to crossdomain restriction.

 <GetFeatureInfo>
 <Format>application/vnd.ogc.gml</Format>
 <DCPType>
 <HTTP>
 <Get>
 <OnlineResource xlink:href="http://www.proxy-easysdi:8080/proxy/ogc/myvirtualwms?"/>
 </Get>
 <Post>
 <OnlineResource xlink:href="http://www.proxy-easysdi:8080/proxy/ogc/myvirtualwms?"/>
 </Post>
 </HTTP>
 </DCPType>
 </GetFeatureInfo>
 

To get around this problem, the EasySDI Proxy proposes a Host translator option for each proxied service (called Virtual Service, see EasySDI component Service documentation).
Use your reverse proxy URL as the host translator, will allow the EasySDI Proxy to overwrite all the URL contained in the capabilities document and then all the requests from the Map viewer to be correctly redirected.

To follow the previous example :
- You set a vitual service named 'myvirtualwms' in your EasySDI Proxy configuration.
- The original address of this service is www.proxy-easysdi:8080/proxy/ogc/myvirtualwms
- With the configured Apache reverse proxy, this service can be reached at www.my-easysdi.com/proxy/ogc/myvirtualwms
- Set "www.my-easysdi.com/proxy/ogc/myvirtualwms" as the Host Translator value, then the capabilities document will be overwritten and expose redirected URL, eg :

 <GetFeatureInfo>
 <Format>application/vnd.ogc.gml</Format>
 <DCPType>
 <HTTP>
 <Get>
 <OnlineResource xlink:href="http://www.my-easysdi.com/proxy/ogc/myvirtualwms?"/>
 </Get>
 <Post>
 <OnlineResource xlink:href="http://www.my-easysdi.com/proxy/ogc/myvirtualwms?"/>
 </Post>
 </HTTP>
 </DCPType>
 </GetFeatureInfo>
 

Print service

It is required to deploy the mapfish print servlet available here : https://forge.easysdi.org/projects/easysdi/files

  • Url of the print service

Url of the mapfish-print service, eg : http://localhost/print-servlet/pdf/
If this URL is not defined, the Print tool will be automatically disabled.

  • Url of the method print

Url of the print method.
If not set, it will be deducted from the print service URL like this :
[print service url]print.pdf

  • Url of the method create

Url of the create method.
If not set, it will be deducted from the print service URL like this :
[print service url]create.json

Layer groups properties


Layer groups are used to gather layers by theme/subject in the map viewer.

  • Name : visible denomination of the group in the layers tree
  • Alias : internal denomination of the group in the map viewer.
    The alias 'background' is a reserved word used by the viewer to identify the background layer group (typically, a background layer group contains exclusive base layers).
    As background group is defined by context and is not an intrinsic property of a group, the used of this alias is protected.
  • is default open : initial opening status of the group

Layer properties


  • Name : initial layer name in the layer tree, overwrite with the value from the capabilities of the service
  • Alias : internal denomination
  • Type : GeoExt or Leaflet Map type
  • Overlay Groups : group to which the layer belongs to
  • Service : physical or virtual service from which the layer is issued
  • Authentication : optional user/password fields in case of the selected service requires authentication
  • Layer : layer name as defined in the service. Button at the right of this combobox executes a GetCapabilities on the selected service and populates with layer names this element
  • Tiled : layer tiled state
  • Default visible : initial layer visibility
  • Opacity : initial layer opacity
  • Metadata link : url to a web page. If defined, the layer tree node will be rendered as a link.
  • To add as an OpenLayers layer
    Adding a layer to the viewer is done by using high-level libraries options (OpenGeo SDK and GeoExt).
    However, this option allow to define a layer directly with the low-level librarie OpenLayers.
    This can be usefull when :
    - some specific parameters are not handle by the high-level libraries
    - the layer to add is a WMTS which does not have a high-level libraries handler
The following properties are used to build the OpenLayers layer, in combination with the previous generic properties :
  • WMTS
  • Style : One of the advertised layer styles. Must be provided.
  • Matrix Set : One of the advertised matrix set identifiers. Must be provided.
  • Options : All the key/value pairs (comma separated) to add in the 'config' object to send to the layer constructor
new OpenLayers.Layer.WMTS (config)

eg :
format:"image/png",
 dimensions:[],
 requestEncoding: "KVP",
 matrixIds:[
 {identifier:"0",scaleDenominator:559082264.02,matrixWidth:1,matrixHeight:1,tileWidth:256,tileHeight:256,topLeftCorner:{lon:-20037508.34,lat:20037508.34 }},
 {identifier:"1",scaleDenominator:279541132.01,matrixWidth:2,matrixHeight:2,tileWidth:256,tileHeight:256,topLeftCorner:{lon:-20037508.34,lat:20037508.34 }},
 {identifier:"2",scaleDenominator:139770566.00,matrixWidth:4,matrixHeight:4,tileWidth:256,tileHeight:256,topLeftCorner:{lon:-20037508.34,lat:20037508.34 }},
 {identifier:"3",scaleDenominator:698852830.03,matrixWidth:8,matrixHeight:8,tileWidth:256,tileHeight:256,topLeftCorner:{lon:-20037508.34,lat:20037508.34 }}
 ]

NB : To allow a WMTS layer with a KVP request Encoding to be print with MapFish Print, the matrixIds param must be provided with all the properties present in the previous example.

  • WMS/WMS-C
  • Style : One of the advertised layer styles. Must be provided.
  • Options : All the key/value pairs (comma separated) to add in the 'options' object to send to the layer constructor
new OpenLayers.Layer.WMS (name, url, params, options)

eg :
resolutions: [1056.633663,528.3168317,264.1584158,132.0792079,66.03960396,26.41584158, 13.229166668, 6.614583334, 2.645833334],
 attribution:'<a href="http://www.provider.org/" target="_blank"><img src="http://provder.org/logo.gif"></a>
 <a href="http://www.provider.org/terms.pdf" alt="TOS" title="TOS" target="_blank">Terms of Service</a>

Map context properties


  • Name : page title
  • Alias : internal identifier
  • Url : URL to view the context (with the default Joomla! template. To go further on integrated context in Joomla!, see Defining Context Links)
  • Background group : group to use as background group. This means that layers of this group will be used as base layers in the map.
  • Overlay Groups : groups to use as overlay group.
  • Default adding group : the layer adding with the "Add layer" tool will be here. If not set, the first overlay group will be used for that purpose.
  • Service : available services in this context. This list must contain all the services delivering the layers belonging to the selected groups (background and overlay).
    This list can contain additional services available for adding layer with the "Add layer" tool.
  • Default service type : when using a Proxyhost (see System_environment), you can dynamically add services in the viewer. The type of those services must be set here. Only one type by context.
  • Srs : System reference system of the map, eg : EPSG:900913
  • Unit : Unit of the map.
  • Center coordinates : Center coordinates, in the previous srs, of the map, eg : -900, 5350000
  • Max resolution : max resolution of the map, eg : 156543
  • Max extent : max extent, in the previous srs, of the map, eg : -1100000,4600000,989115,6216470
  • Root node text : optional text to overwrite the layer tree root node text. Default value is empty.
  • Map title : Title of the document to print
  • Abstract : Abstract of the document to print
  • Tools : list of the tools available in the context. No dependencies between each other.

Applying Joomla template to Geodata viewer

EasySDI Map is delivered with the minimum css defined to have a nice render in the default Joomla! template Protostar.

If you want to use your own template or refine the default rendering, you need to do some CSS override in your own JOOMLA template.

Loading a context

Defining Joomla! links

To allow user access to the defined contexts, EasySDI administrator has to provide links to them.

A direct link is automatically build at the context creation. It can be found in the context list form (column "Url") or in the context edition form (field "Url"). This link can be used as it is.

Or, the administrator can choose to build a link based on Joomla! functionnalities. These links would be made as new menu items:
  • Follow the described steps here http://docs.joomla.org/Adding_a_new_menu_item
  • In step 5, select "EasySDI component Map : context view" as the item type.
  • In step 6, set the "Context id" param with the value visible in the context list form or in the context edition form.
  • "Target window" and "Template Style" are two parameters that are very usefull to customize your viewer.

Access process

When a context is requested by a user, the following check access level process is executed :

easysdi_picto_map.jpg (3.82 KB) Portier Thomas, 04/07/2014 12:33 PM

UI-map.png (50.8 KB) Portier Thomas, 04/07/2014 12:49 PM

access_map.png (68.2 KB) Portier Thomas, 04/07/2014 12:49 PM

access_map.png (68.2 KB) Portier Thomas, 04/07/2014 01:27 PM