Skip to content

GeoLocationMenu

Tobia edited this page May 23, 2013 · 5 revisions

This plugin allow the possibility to incapsulate several other tools (already availables on MapStore separately) inside a single Menu. This feature avoit rendering problems manly when you are working on a Embed Map (usually the map is smaller).

The related plugins functionalities managed by the GeoLocalizationMenu are:

  • DynamicGeocoder
  • ReverseGeocoder
  • Geolocate(if enabled, no by default)
  • GeoReferences

As you can see, this plugin is enabled by default both for the Composer that for the Viewer modes through the configuration below (you have to use this configuration to enable this plugin with a default configuration):

{ "ptype": "gxp_geolocationmenu", "outputTarget": "paneltbar", "index": 23 }

By defaul the Geolocate plugin isnt enabled in inside the GeoLocationMenu. In order to enable the Geolocate you can use the configuration approach below:

 {
		"ptype": "gxp_geolocationmenu",
		"outputTarget": "paneltbar",
		"enableDefaultGeolocate": true,
		"index": 23
 }

In this way a default configuration of the plugin is used. However you can also overwrite the default configuration privided inside the plugin using the configuration below for example:

 {
		"ptype": "gxp_geolocationmenu",
		"outputTarget": "paneltbar",
		"geolocate": {
			"geolocateMenuText": "Geolocate",
			"trackMenuText": "Track Position",
			"geolocateTooltip": "Locate my position",
			"enableTracking" : false,
			"layerName": "Position",
			"bind": true,
			"zoom": true,
			"displayInLayerSwitcher": false,
			"geolocationStyles": {
				"pointStyle": {
						"graphicName": "circle",
						"strokeColor": "#aaa",
						"fillColor": "#11f",
						"strokeWidth": 2,
						"fillOpacity": 0.7,
						"strokeOpacity": 0.6,
						"pointRadius": 5                          
				},
				"auraStyle": { 
						"fillOpacity": 0.3,
						"fillColor": "#55b",
						"strokeColor": "#00f",
						"strokeOpacity": 0.6
				},
				"geolocationOptions": {
					"enableHighAccuracy": true,
					"maximumAge": 0,
					"timeout": 7000
				}
			}
		},
		"index": 23
 } 

NOTE: If the 'geolocate' property is specified inside the plugin configuration this is used and not the default.