-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sur les exemples Leaflet avec un appel de Gp.Services.getConfig()
- Loading branch information
1 parent
6b8634e
commit 59efde6
Showing
11 changed files
with
245 additions
and
16 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
53 changes: 53 additions & 0 deletions
53
samples-src/pages/leaflet/Default/pages-leaflet-bundle-getconfig.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,53 @@ | ||
{{#extend "layout-leaflet-sample-bundle-getconfig"}} | ||
|
||
{{#content "head"}} | ||
<title>Sample Leaflet</title> | ||
{{/content}} | ||
|
||
{{#content "style"}} | ||
<style> | ||
div#map { | ||
width: 100%; | ||
height: 500px; | ||
} | ||
</style> | ||
{{/content}} | ||
|
||
{{#content "body"}} | ||
<h2>Ajout de tous les widgets</h2> | ||
<!-- map --> | ||
<div id="map"></div> | ||
{{/content}} | ||
|
||
{{#content "js"}} | ||
// on cache l'image de chargement du Géoportail. | ||
document.getElementById("map").style.backgroundImage = "none"; | ||
|
||
// Création de la map | ||
var layer = L.geoportalLayer.WMTS({ | ||
layer : "ORTHOIMAGERY.ORTHOPHOTOS" | ||
}); | ||
|
||
var map = L.map('map', { | ||
zoom : 2, | ||
center : L.latLng(48, 2) | ||
}); | ||
|
||
layer.addTo(map); | ||
|
||
var iso = L.geoportalControl.Isocurve(); | ||
map.addControl(iso); | ||
var layerSwitcher = L.geoportalControl.LayerSwitcher(); | ||
map.addControl(layerSwitcher); | ||
var mp = L.geoportalControl.MousePosition(); | ||
map.addControl(mp); | ||
var route = L.geoportalControl.Route(); | ||
map.addControl(route); | ||
var reverse = L.geoportalControl.ReverseGeocode(); | ||
map.addControl(reverse); | ||
var search = L.geoportalControl.SearchEngine(); | ||
map.addControl(search); | ||
var measureProfil = L.geoportalControl.ElevationPath(); | ||
map.addControl(measureProfil); | ||
{{/content}} | ||
{{/extend}} |
78 changes: 78 additions & 0 deletions
78
samples-src/pages/openlayers/Default/pages-ol-bundle-getconfig.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,78 @@ | ||
{{#extend "ol-sample-bundle-getconfig-layout"}} | ||
|
||
{{#content "head"}} | ||
<title>Sample openlayers - multikeys</title> | ||
{{/content}} | ||
|
||
{{#content "style"}} | ||
<style> | ||
div#map { | ||
width: 100%; | ||
height: 500px; | ||
} | ||
</style> | ||
{{/content}} | ||
|
||
{{#content "body"}} | ||
<h2>Ajout de tous les widgets</h2> | ||
<!-- map --> | ||
<div id="map"> | ||
</div> | ||
{{/content}} | ||
|
||
{{#content "js"}} | ||
// on cache l'image de chargement du Géoportail. | ||
document.getElementById("map").style.backgroundImage = "none"; | ||
|
||
// Création de la map | ||
var map = new ol.Map({ | ||
target : "map", | ||
layers : [ | ||
new ol.layer.GeoportalWMTS({ | ||
layer : "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2" | ||
}), | ||
new ol.layer.GeoportalWMTS({ | ||
layer : "GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40" | ||
}), | ||
new ol.layer.GeoportalWMTS({ | ||
layer : "LIMITES_ADMINISTRATIVES_EXPRESS.LATEST" | ||
}) | ||
], | ||
view : new ol.View({ | ||
center : [288074.8449901076, 6247982.515792289], | ||
zoom : 13 | ||
}) | ||
}); | ||
|
||
var drawing = new ol.control.Drawing(); | ||
map.addControl(drawing); | ||
var iso = new ol.control.Isocurve(); | ||
map.addControl(iso); | ||
var layerImport = new ol.control.LayerImport(); | ||
map.addControl(layerImport); | ||
var layerSwitcher = new ol.control.LayerSwitcher(); | ||
map.addControl(layerSwitcher); | ||
var mp = new ol.control.GeoportalMousePosition(); | ||
map.addControl(mp); | ||
var route = new ol.control.Route(); | ||
map.addControl(route); | ||
var reverse = new ol.control.ReverseGeocode({}); | ||
map.addControl(reverse); | ||
var search = new ol.control.SearchEngine({}); | ||
map.addControl(search); | ||
var feature = new ol.control.GetFeatureInfo({}); | ||
map.addControl(feature); | ||
|
||
var measureLength = new ol.control.MeasureLength(); | ||
map.addControl(measureLength); | ||
var measureArea = new ol.control.MeasureArea(); | ||
map.addControl(measureArea); | ||
var measureAzimuth = new ol.control.MeasureAzimuth(); | ||
map.addControl(measureAzimuth); | ||
var measureProfil = new ol.control.ElevationPath(); | ||
map.addControl(measureProfil); | ||
|
||
var attributions = new ol.control.GeoportalAttribution(); | ||
map.addControl(attributions); | ||
{{/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
45 changes: 45 additions & 0 deletions
45
samples-src/templates/leaflet/layout-leaflet-sample-bundle-getconfig.hbs
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,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{{#extend "partials-common-head"}} | ||
{{/extend}} | ||
{{#extend "partials-leaflet-common-head"}} | ||
{{/extend}} | ||
{{#block "vendor"}} | ||
{{/block}} | ||
|
||
{{#extend "partials-leaflet-bundle-getconfig-head"}} | ||
{{/extend}} | ||
|
||
{{#block "head"}} | ||
{{/block}} | ||
{{#block "style"}} | ||
{{/block}} | ||
|
||
</head> | ||
<body> | ||
<h1>Extension Géoportail pour Leaflet (mode bundle)</h1> | ||
|
||
{{#block "body"}} | ||
{{/block}} | ||
|
||
<script> | ||
var createMap = function () { | ||
{{#block "js"}} | ||
{{/block}} | ||
}; | ||
Gp.Services.getConfig({ | ||
// callbackSuffix : '', | ||
apiKey: "{{ apikey }}", | ||
timeOut: 20000, | ||
onSuccess: createMap, | ||
onFailure: function (e) { | ||
console.error(e); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
41 changes: 41 additions & 0 deletions
41
samples-src/templates/openlayers/ol-sample-bundle-getconfig-layout.hbs
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,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{{#extend "partials-common-head"}} | ||
{{/extend}} | ||
{{#extend "partials-ol-common-head"}} | ||
{{/extend}} | ||
{{#block "vendor"}} | ||
{{/block}} | ||
{{#extend "partials-ol-bundle-getconfig-head"}} | ||
{{/extend}} | ||
|
||
{{#block "head"}} | ||
{{/block}} | ||
{{#block "style"}} | ||
{{/block}} | ||
|
||
</head> | ||
<body> | ||
<h1>Extension Géoportail pour OpenLayers</h1> | ||
|
||
{{#block "body"}} | ||
{{/block}} | ||
|
||
<script> | ||
var createMap = function () { | ||
{{#block "js"}} | ||
{{/block}} | ||
}; | ||
Gp.Services.getConfig({ | ||
// callbackSuffix : '', | ||
apiKey: "{{ apikey }}", | ||
timeOut: 20000, | ||
onSuccess: createMap | ||
}); | ||
</script> | ||
</body> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
samples-src/templates/partials/leaflet/partials-leaflet-bundle-getconfig-head.hbs
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,4 @@ | ||
<!-- Leaflet Library --> | ||
<script src="{{ baseurl }}/node_modules/leaflet/dist/leaflet{{ debug }}.js"></script> | ||
<!-- Geoportal Extension for Leaflet --> | ||
<script src="{{ baseurl }}/dist/leaflet/GpPluginLeaflet{{ mode }}.js"></script> |
5 changes: 5 additions & 0 deletions
5
samples-src/templates/partials/openlayers/partials-ol-bundle-getconfig-head.hbs
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,5 @@ | ||
<!-- Library OpenLayers --> | ||
<!-- <script src="https://openlayers.org/en/{{ version }}/build/ol.js"></script> --> | ||
<script src="{{ resources }}/vendor/ol/{{ version }}/ol.js"></script> | ||
<!-- Plugin OpenLayers IGN --> | ||
<script src="{{ baseurl }}/dist/openlayers/GpPluginOpenLayers{{ mode }}.js"></script> |
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