When working with gotmap you may want to change the default settings of the map, this is done by editing the GotMapEngine.Options.
The GotMapEngine.Options are copied to every instance of the map when it is created, so all changes to the GotMapEngine.Options will take effect in all map instances cerated after the changes are done.
My sugestion is to make a .js-file called someting like gotmapsettings.js and include it in the html-pages where you will be using the map, this file should contain all the changes you whant on the default settings, and looks somethin like the code bellow.
(see the AIP to get a complete list of the available settings)
The map mainly uses GeoJSON to draw features.
To enable a wider array of functionality, gotmap has implemented some custom GeoJSON-properties.
Property | Alt | Type | Description |
---|---|---|---|
useMarkers | um | bool | Whether to use markers or not (will draw circles if false, null or undefined) |
customIconUrl | ciu | string | The compelete url to the desired marker icon or the complete name of the icon image if you are the builtin icons. (will use the default marker if null, or undefined) |
customIconWidth | ciw | int | The width of the icon in pixels |
customIconHeight | cih | int | The height of the icon in pixels |
customIconAnchorX | ciax | int | The X-coordinate of the "tip" of the icon (relative to its top left corner). |
customIconAnchorY | ciay | int | The Y-coordinate of the "tip" of the icon (relative to its top left corner). |
customIconPopupAnchorX | cipax | int | The X-coordinate of the point from which popups will "open", relative to the icon anchor. |
customIconPopupAnchorY | cipay | int | The Y-coordinate of the point from which popups will "open", relative to the icon anchor. |
customIconShadowIconUrl | cisiu | string | The compelete url to the desired shadow image or "marker-shadow.png" if you are the builtin icons. (will use the default shadow if null, or undefined) |
customIconShadowWidth | cisw | int | The width of the shadow in pixels |
customIconShadowHeight | cish | int | The height of the shadow in pixels |
customIconShadowAnchorX | cisax | int | The X-coordinate of the "tip" of the shadow (relative to its top left corner). |
customIconShadowAnchorY | cisay | int | The Y-coordinate of the "tip" of the shadow (relative to its top left corner). |
Property | Alt | Type | Description |
---|---|---|---|
color | c | string | The overall color of the feature. |
opacity | o | double | The overall opacity of the feature. |
fillColor | fc | double | The color of the inside of the feature(Circles and Polygons). |
fillOpacity | fo | double | The opacity of the inside of the feature. |
radius | r | int | The radius of the feature (only used by Circle-features). |
weight | wgt | int | The width of the features outlining. |
clusterClass | cc | string | A css classname to add to single marker clusters. |
Property | Alt | Type | Description |
---|---|---|---|
popUpContent | puc | string | Html that will be shown in the popup (bound to left click on the feature) |
var server = GotMapEngine.OGCServerManager.CreateServer(
'url.to.server'
, GotMapEngine.Enums.OGCServerTypes.WMS //use ...OGCServerTypes.WFS for wfs servers
, {
version: '1.1.1'
, useProxy: false
, altUrl: 'alternateurl.to.server' //an alternate serverurl to a server housing the same layers (fallback server)
}
);
var server = undefined;
var url = 'url.to.server';
var useProxy = false;
//use ...OGCServerTypes.WFS for wfs servers
if (GotMapEngine.OGCServerManager.ServerExists(url, GotMapEngine.Enums.OGCServerTypes.WMS)) {
server = GotMapEngine.OGCServerManager.GetServer(url, GotMapEngine.Enums.OGCServerTypes.WMS);
}
else {
//create a temporary server
server = new GotMapEngine.Classes.OGCServer(url, GotMapEngine.Enums.OGCServerTypes.WMS, { isCorsEnabled: useProxy != undefined ? !useProxy : true });
}
A local url which purpose is to relay http requests to external servers and results back to the client.
GotMap expects a http-relay to be implemented as an url that recives the desired url as a get parameter.
ex: http://excample.com/relay?url=http://the_desired_url.com&firstgetparam=param&second.....
The Options RelayProxyUrl="http://excample.com/relay" and RelayProxyParameterName="url" needs to be set eighter in the GotMap instanse or in GotMapEngine.Options for this to work.
Using a http-relay problems such as cross-domain ajax and accessing servers on the same network as the webserver can be avoided.
Note: When opening up for requests like this there is great need for safeguards prohibiting requests to protected internal servers!
Alla lager är grupperade i s.k lagergrupper. I denna meny kan du välja att aktivera ett, flera eller alla lager i en eller flera lagergrupper samt få information om färger och symboler i ett lager.
Indikerar att lagret eller alla lager i gruppen är inaktiva(visas ej). Ett klick aktiverar lagret eller alla lager i gruppen.
Indikerar att lagret eller alla lager i gruppen är aktiva(visas). Ett klick avaktiverar lagret eller alla lager i gruppen.
Indikerar att något eller några men inte alla lager i gruppen är aktiva. Ett klick aktiverar alla lager i gruppen.
Indikerar att gruppen inte är expanderad. Ett klick expanderar gruppen.
Indikerar att gruppen är expanderad. Ett klick minimerar gruppen.
Ett klick på denna knapp öppnar ett fönster med information om lagrets färger och symboler.
Du kan också ändra utritningsordningen av lagren. Detta görs genom att hålla nere vänster mus-knapp och "dra och släpp" på lagret. På samma sätt kan du ändra ordningen på lagergrupperna.