new LayerImport(options)
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object |
options for function call.
|
Example
var LayerImport = new ol.control.LayerImport({
"collapsed" : false,
"draggable" : true,
"layerTypes" : ["KML", "GPX"],
"webServicesOptions" : {
"proxyUrl" : "http://localhost/proxy/php/proxy.php?url=",
"noProxyDomains" : []
},
"vectorStyleOptions" : {
"KML" : {
extractStyles : true,
defaultStyle : new ol.style.Style({
image : new ol.style.Icon({
src : "data:image/png;base64....",
size : [51, 38],
}),
stroke : new ol.style.Stroke({
color : "#ffffff",
width : 7
}),
fill : new ol.style.Fill({
color : "rgba(255, 183, 152, 0.2)"
}),
text : new ol.style.Text({
font : "16px Sans",
textAlign : "left",
fill : new ol.style.Fill({
color : "rgba(255, 255, 255, 1)"
}),
stroke : new ol.style.Stroke({
color : "rgba(0, 0, 0, 1)",
width : 2
})
})
})
},
"GPX" : {
defaultStyle : new ol.style.Style({
image : new ol.style.Icon({
src : "path/to/my/icon.png",
size : [51, 38],
}),
stroke : new ol.style.Stroke({
color : "#ffffff",
width : 7
})
})
}
}
});
Extends
- ol.control.Control
Members
-
collapsed
-
{Boolean} specify if LayerImport control is collapsed (true) or not (false)
-
draggable
-
{Boolean} specify if LayerImport control is draggable (true) or not (false)
Methods
-
_onLoadedMapBox(e)
Controls/LayerImport/LayerImport.js, line 1840 -
this method is called when the editor is loaded
Name Type Description e Object editor
-
getCollapsed(){Boolean}
Controls/LayerImport/LayerImport.js, line 297 -
Returns true if widget is collapsed (minimized), false otherwise
Returns:
- true if widget is collapsed
-
getContainer(){DOMElement}
Controls/LayerImport/LayerImport.js, line 354 -
Get container
-
getName(){String}
Controls/LayerImport/LayerImport.js, line 345 -
Returns layer name
Returns:
- layer name
-
getServiceImportContent(){String}
Controls/LayerImport/LayerImport.js, line 336 -
Returns content of a service import (GetCapabilities)
Returns:
- content service
-
getStaticImportContent(){String}
Controls/LayerImport/LayerImport.js, line 327 -
Returns content of a static import (KML, GPX or GeoJSON)
Returns:
- content static
-
setCollapsed(collapsed)
Controls/LayerImport/LayerImport.js, line 306 -
Collapse or display widget main container
Name Type Description collapsed Boolean True to collapse widget, False to display it
-
setMap(map)
Controls/LayerImport/LayerImport.js, line 224 -
Overwrite OpenLayers setMap method
Name Type Description map ol.Map Map.