-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from IGNF/feature/right-click-menu
menu contextuel clic droit
- Loading branch information
Showing
16 changed files
with
1,280 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
samples-src/pages/tests/ContextMenu/pages-ol-modules-contextmenu-dsfr.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
{{#extend "ol-sample-modules-dsfr-layout"}} | ||
{{#content "vendor"}} | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlLayerSwitcher.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlLayerSwitcher.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlIsocurve.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlIsocurve.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlLayerImport.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlLayerImport.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlRoute.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlRoute.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlCatalog.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlCatalog.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlLegends.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlLegends.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlContextMenu.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlContextMenu.js"></script> | ||
{{/content}} | ||
{{#content "head"}} | ||
<title>Sample openlayers ContextMenu dsfr</title> | ||
{{/content}} | ||
{{#content "style"}} | ||
<style> | ||
div#map { | ||
width: 100%; | ||
height: 700px; | ||
} | ||
</style> | ||
{{/content}} | ||
{{#content "body"}} | ||
<h2>Ajout de tous les widgets</h2> | ||
<!-- map --> | ||
<div id="map"> | ||
</div> | ||
{{/content}} | ||
|
||
{{#content "js"}} | ||
<script> | ||
var map; | ||
var createMap = function () { | ||
document.getElementById('map').style.backgroundImage = 'none'; | ||
|
||
// 1. Création de la map | ||
map = new ol.Map({ | ||
target : "map", | ||
view : new ol.View({ | ||
center : [288074.8449901076, 6247982.515792289], | ||
zoom : 6 | ||
}) | ||
}); | ||
|
||
// 2. Ajout de plusieurs couches différentes. | ||
var gpMaps = new ol.layer.Tile({ | ||
source : new ol.source.GeoportalWMTS({ | ||
layer: "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2" | ||
}) | ||
}); | ||
map.addLayer(gpMaps); | ||
|
||
// 3. Ajout du context menu | ||
var itemsOpt = [ { | ||
text : "Imprimer la carte", | ||
classname : "ol-context-menu-custom fr-text--md", | ||
callback : function() {alert("fonction à ajouter IMPRESSION!!")}, | ||
}] | ||
|
||
var contextMenu = new ol.control.ContextMenu({ | ||
contextMenuItemsOptions : itemsOpt | ||
}); | ||
map.addControl(contextMenu); | ||
|
||
|
||
// 5. Ajout du contrôle de gestion de l'empilement des couches (layerSwitcher) | ||
var layerSwitcher = new ol.control.LayerSwitcher({ | ||
options : { | ||
collapsed: false | ||
} | ||
}); | ||
map.addControl(layerSwitcher); | ||
|
||
var iso = new ol.control.Isocurve({ | ||
draggable: true, | ||
position : "bottom-left" | ||
}); | ||
map.addControl(iso); | ||
|
||
var layerImport = new ol.control.LayerImport({ | ||
draggable: true, | ||
position : "bottom-left" | ||
}); | ||
map.addControl(layerImport); | ||
|
||
var route = new ol.control.Route({ | ||
draggable: true, | ||
position : "bottom-right", | ||
listable: true, | ||
description: "Calculez un itinéraire véhicule ou piéton entre deux ou plusieurs points", | ||
}); | ||
map.addControl(route); | ||
|
||
var legends = new ol.control.Legends({ | ||
draggable: true, | ||
position: "bottom-left", | ||
panel: true, | ||
auto: true | ||
}); | ||
map.addControl(legends); | ||
var catalog = new ol.control.Catalog({ | ||
draggable: true, | ||
position: "top-left", | ||
panel: true, | ||
auto: true | ||
}); | ||
map.addControl(catalog); | ||
}; | ||
Gp.Services.getConfig({ | ||
customConfigFile : "https://data.geopf.fr/annexes/cartes.gouv.fr-config/public/layers.json", | ||
callbackSuffix : "", | ||
// apiKey: "essentiels,cartes,adresse,lambert93", | ||
timeOut : 20000, | ||
onSuccess : createMap, | ||
onFailure : (e) => { | ||
console.error(e); | ||
} | ||
}); | ||
</script> | ||
{{/content}} | ||
{{/extend}} | ||
|
128 changes: 128 additions & 0 deletions
128
samples-src/pages/tests/ContextMenu/pages-ol-modules-contextmenu.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
{{#extend "ol-sample-modules-layout"}} | ||
{{#content "vendor"}} | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlLayerSwitcher.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlLayerSwitcher.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlIsocurve.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlIsocurve.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlLayerImport.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlLayerImport.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlRoute.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlRoute.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlCatalog.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlCatalog.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlLegends.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlLegends.js"></script> | ||
<link rel="stylesheet" href="{{ baseurl }}/dist/modules/GpfExtOlContextMenu.css" /> | ||
<script src="{{ baseurl }}/dist/modules/GpfExtOlContextMenu.js"></script> | ||
{{/content}} | ||
{{#content "head"}} | ||
<title>Sample openlayers ContextMenu dsfr</title> | ||
{{/content}} | ||
{{#content "style"}} | ||
<style> | ||
div#map { | ||
width: 100%; | ||
height: 700px; | ||
} | ||
</style> | ||
{{/content}} | ||
{{#content "body"}} | ||
<h2>Ajout de tous les widgets</h2> | ||
<!-- map --> | ||
<div id="map"> | ||
</div> | ||
{{/content}} | ||
|
||
{{#content "js"}} | ||
<script> | ||
var map; | ||
var createMap = function () { | ||
document.getElementById('map').style.backgroundImage = 'none'; | ||
|
||
// 1. Création de la map | ||
map = new ol.Map({ | ||
target : "map", | ||
view : new ol.View({ | ||
center : [288074.8449901076, 6247982.515792289], | ||
zoom : 6 | ||
}) | ||
}); | ||
|
||
// 2. Ajout de plusieurs couches différentes. | ||
var gpMaps = new ol.layer.Tile({ | ||
source : new ol.source.GeoportalWMTS({ | ||
layer: "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2" | ||
}) | ||
}); | ||
map.addLayer(gpMaps); | ||
|
||
// 3. Ajout du context menu | ||
var itemsOpt = [ { | ||
text : "Imprimer la carte", | ||
classname : "ol-context-menu-custom fr-text--md", | ||
callback : function() {alert("fonction à ajouter IMPRESSION!!")}, | ||
}] | ||
|
||
var contextMenu = new ol.control.ContextMenu({ | ||
contextMenuItemsOptions : itemsOpt | ||
}); | ||
map.addControl(contextMenu); | ||
|
||
|
||
// 5. Ajout du contrôle de gestion de l'empilement des couches (layerSwitcher) | ||
var layerSwitcher = new ol.control.LayerSwitcher({ | ||
options : { | ||
collapsed: false | ||
} | ||
}); | ||
map.addControl(layerSwitcher); | ||
|
||
var iso = new ol.control.Isocurve({ | ||
draggable: true, | ||
position : "bottom-left" | ||
}); | ||
map.addControl(iso); | ||
|
||
var layerImport = new ol.control.LayerImport({ | ||
draggable: true, | ||
position : "bottom-left" | ||
}); | ||
map.addControl(layerImport); | ||
|
||
var route = new ol.control.Route({ | ||
draggable: true, | ||
position : "bottom-right", | ||
listable: true, | ||
description: "Calculez un itinéraire véhicule ou piéton entre deux ou plusieurs points", | ||
}); | ||
map.addControl(route); | ||
|
||
var legends = new ol.control.Legends({ | ||
draggable: true, | ||
position: "bottom-left", | ||
panel: true, | ||
auto: true | ||
}); | ||
map.addControl(legends); | ||
var catalog = new ol.control.Catalog({ | ||
draggable: true, | ||
position: "top-left", | ||
panel: true, | ||
auto: true | ||
}); | ||
map.addControl(catalog); | ||
}; | ||
Gp.Services.getConfig({ | ||
customConfigFile : "https://data.geopf.fr/annexes/cartes.gouv.fr-config/public/layers.json", | ||
callbackSuffix : "", | ||
// apiKey: "essentiels,cartes,adresse,lambert93", | ||
timeOut : 20000, | ||
onSuccess : createMap, | ||
onFailure : (e) => { | ||
console.error(e); | ||
} | ||
}); | ||
</script> | ||
{{/content}} | ||
{{/extend}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.