Optionalcollapsed?: booleanSpecify if LayerImport control should be collapsed at startup. Default is true.
Optionaldraggable?: booleanSpecify if widget is draggable
Optionalid?: numberAbility to add an identifier on the widget (advanced option)
OptionallayerTypes?: any[]data types that could be imported : "KML", "GPX", "GeoJSON", "WMS", "WMTS" and "MAPBOX". Values will be displayed in the same order in widget list.
OptionalvectorStyleOptions?: {Options for imported vector layer styling (KML, GPX, GeoJSON)
OptionalGeoJSON?: { defaultStyle?: any }Options for GeoJSON layer styling
OptionaldefaultStyle?: anydefault style to be applied to GeoJSON imports in case no style is defined. defaultStyle is an ol.style.Style object.
OptionalGPX?: { defaultStyle?: any }Options for GPX layer styling
OptionaldefaultStyle?: anydefault style to be applied to GPX imports in case no style is defined. defaultStyle is an ol.style.Style object.
OptionalKML?: { defaultStyle?: any; extractStyles?: boolean; showPointNames?: boolean }Options for KML layer styling
OptionaldefaultStyle?: anydefault style to be applied to KML imports in case no style is defined. defaultStyle is an ol.style.Style object.
OptionalextractStyles?: booleanExtract styles from the KML. Default is true.
OptionalshowPointNames?: booleanShow names as labels for KML placemarks which contain points. Default is true.
OptionalMapBox?: { defaultStyle?: any; display?: boolean; editor?: any }Options for MapBox layer styling
OptionaldefaultStyle?: anydefault style to be applied to MapBox imports in case no style is defined. defaultStyle is an ol.style.Style object.
Optionaldisplay?: booleandisplay tools editor
Optionaleditor?: anyoptions for tools editor
OptionalwebServicesOptions?: { noProxyDomains?: string[]; proxyUrl?: string }Options to import WMS or WMTS layers
OptionalnoProxyDomains?: string[]Proxy will not be used for this list of domain names. Only use if you know what you're doing.
OptionalproxyUrl?: stringProxy URL to avoid cross-domain problems. Mandatory to import WMS and WMTS layer.
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
})
})
}
}
});
ProtecteddisposedThe object has already been disposed.
ProtectedlistenerKey name.
Listener.
Type.
Listener.
ProtectedapplyProtectedApply any properties from another object without triggering events.
The source object.
Dispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type property.
Event object.
false if anyone called preventDefault on the
event object or if any of the listeners returned false.
Clean up.
ProtecteddisposeProtectedExtension point for disposable objects.
Returns true if widget is collapsed (minimized), false otherwise
collapsed - true if widget is collapsed
Get container
container
Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.
Type.
Listeners.
Returns layer name
name - layer name
Get an object of all property names and values.
Object.
Returns content of a service import (GetCapabilities)
contentService - content service
Returns content of a static import (KML, GPX or GeoJSON)
contentStatic - content static
Optionaltype: stringType. If not provided,
true will be returned if this event target has any listeners.
Has listeners.
The object has properties.
Key name.
Old value.
ProtectedonceProtectedonKey name.
Listener.
Type.
Listener.
Collapse or display widget main container
True to collapse widget, False to display it
Overwrite OpenLayers setMap method
Map.
This function is used to set a target element for the control. It has no
effect if it is called after the control has been added to the map (i.e.
after setMap is called on the control). If no target is set in the
options passed to the control constructor and if setTarget is not called
then the control is added to the map's overlay container.
Target.
ProtectedunProtectedUnlisten for a certain type of event.
Type.
Listener.
options for function call.