new Territories(options)
Controls/Territories/Territories.js, line 49
Name | Type | Description |
---|---|---|
options | Object |
options for function call. |
Fires:
- custom:action
Example
var territories = new ol.control.Territories({
collapsed: true,
panel: true,
auto: true
});
map.addControl(territories);
or/and
var territories = new ol.control.Territories({});
territories.setTerritory({id: "MTQ", title: "Martinique", description: "", bbox: [], thumbnail: "data:image/png;base64,..."});
territories.setTerritory({id: "GLP", title: "Guadeloupe", description: "", bbox: [], thumbnail: "http://..."});
map.addControl(territories);
Extends
- ol.control.Control
Members
-
auto
-
{Boolean} specify if we load the list of territories by default
-
collapsed
-
{Boolean} specify if control is collapsed (true) or not (false)
-
draggable
-
{Boolean} specify if control is draggable (true) or not (false)
-
territories
-
{Array} list of object territories
Example
{ dom : { HTMLelment }, data : { id: "MTQ", title: "Martinique", description: "", bbox: [minx, miny, maxx, maxy], thumbnail: "data:image/png;base64,..." } }
Methods
-
getContainer(){DOMElement}
Controls/Territories/Territories.js, line 239 -
Get container
-
onCloseTerritoriesClick(e)
Controls/Territories/Territories.js, line 377 -
...
Name Type Description e * ...
-
onImageTerritoriesClick(e, id)
Controls/Territories/Territories.js, line 387 -
...
Name Type Description e * ...
id * ...
- TODO
-
- ...
-
onShowTerritoriesClick(e)
Controls/Territories/Territories.js, line 365 -
...
Name Type Description e * ...
-
removeTerritory(territory){Boolean}
Controls/Territories/Territories.js, line 181 -
Remove a territory
Name Type Description territory String territory id (FRA, MTQ, ...)
Example
territories.removeTerritory("MTQ"); // id du territoire
-
setCollapse(collapsed)
Controls/Territories/Territories.js, line 204 -
Set collapse
Name Type Description collapsed Boolean true|false
- TODO
-
- ...
-
setMap(map)
Controls/Territories/Territories.js, line 96 -
Overwrite OpenLayers setMap method
Name Type Description map ol.Map Map.
-
setReduce(reduce)
Controls/Territories/Territories.js, line 226 -
Mode reduit des tuiles (uniquement le nom du territoire)
Name Type Description reduce * true|false
-
setTerritory(territory){Boolean}
Controls/Territories/Territories.js, line 155 -
Add a territory
Name Type Description territory Object territory
Example
territories.setTerritory ({ id: "MTQ", title: "Martinique", description: "", bbox: [minx, miny, maxx, maxy], thumbnail: "data:image/png;base64,..." });