-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
317 additions
and
63 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
Large diffs are not rendered by default.
Oops, something went wrong.
102 changes: 102 additions & 0 deletions
102
samples-src/pages/3d/page-layerSwitcher-layer-added-from-ol-bundle.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,102 @@ | ||
{{#extend "sample-bundle-layout-3d"}} | ||
|
||
{{#content "head"}} | ||
<title>Sample SDK 3D Layer Switcher</title> | ||
{{/content}} | ||
|
||
{{#content "style"}} | ||
<style> | ||
#viewerDiv { | ||
height: 600px; | ||
width: 100%; | ||
position: "relative"; | ||
} | ||
</style> | ||
{{/content}} | ||
|
||
{{#content "body"}} | ||
<h1>Test de l'ajout du control LayerSwitcher</h1> | ||
<div id="BoutonSwitchToItowns"> | ||
<input type="button" name="switch" onclick="switchTo3D();" value="Switch from 2D to 3D" /><br /> | ||
</div> | ||
<div id="BoutonSwitchToOl" hidden> | ||
<input type="button" name="switch" onclick="switchTo2D();" value="Switch from 3D to 2D" /><br /> | ||
</div> | ||
<div id="viewerDiv"></div> | ||
{{/content}} | ||
|
||
{{#content "js"}} | ||
<script> | ||
var map = Gp.Map.load("viewerDiv", { | ||
customConfigFile: "{{resources}}/ConfigFile/fullConfig.json", | ||
viewMode: "2d", | ||
controlsOptions: { | ||
layerSwitcher: { | ||
maximised: true | ||
} | ||
}, | ||
layersOptions: { | ||
"GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2": { | ||
originators: [{ | ||
"name": "IGN", | ||
"attribution": "Institut national de l'information géographique et forestière", | ||
"url": "http://www.ign.fr", | ||
"constraints": [{ "crs": "EPSG:4326", "bbox": { "left": -63.09696, "right": 55.826077, "top": 51.073032, "bottom": -21.385712 }, "minScaleDenominator": 0, "maxScaleDenominator": 559082265, "temporalExtent": ["2016-02-18", "2016-02-18"] }] | ||
}] | ||
} | ||
}, | ||
center: { | ||
x: 850357, | ||
y: 6204583 | ||
}, | ||
zoom: 14 | ||
}); | ||
|
||
const resolutions = []; | ||
const matrixIds = []; | ||
const proj3857 = ol.proj.get('EPSG:3857'); | ||
const maxResolution = ol.extent.getWidth(proj3857.getExtent()) / 256; | ||
|
||
for (let i = 0; i < 20; i++) { | ||
matrixIds[i] = i.toString(); | ||
resolutions[i] = maxResolution / Math.pow(2, i); | ||
} | ||
|
||
const tileGrid = new ol.tilegrid.WMTS({ | ||
origin: [-20037508, 20037508], | ||
resolutions: resolutions, | ||
matrixIds: matrixIds | ||
}); | ||
|
||
var orthoSource = new ol.source.WMTS({ | ||
url: 'https://wxs.ign.fr/{{apikey3}}/geoportail/wmts', | ||
layer: 'ORTHOIMAGERY.ORTHOPHOTOS', | ||
matrixSet: 'PM', | ||
format: 'image/jpeg', | ||
projection: 'EPSG:3857', | ||
tileGrid: tileGrid, | ||
style: 'normal', | ||
wrapX: true | ||
}); | ||
|
||
var orthoLayer = new ol.layer.Tile({ | ||
source: orthoSource, | ||
id: 'orthoIGN' | ||
}); | ||
|
||
map.getLibMap().addLayer(orthoLayer); | ||
function switchTo3D() { | ||
map = map.switch2D3D("3d"); | ||
document.getElementById("BoutonSwitchToOl").style.display = "inline"; | ||
document.getElementById("BoutonSwitchToItowns").style.display = "none"; | ||
}; | ||
|
||
function switchTo2D() { | ||
map = map.switch2D3D("2d"); | ||
document.getElementById("BoutonSwitchToItowns").style.display = "inline"; | ||
document.getElementById("BoutonSwitchToOl").style.display = "none"; | ||
}; | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
{ | ||
"homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/sdk.html", | ||
"main" : "dist/GpSDK2D-src.js", | ||
"scripts" : {}, | ||
"directories" : {}, | ||
"version" : "3.4.0", | ||
"repository" : { | ||
"url" : "https://github.com/IGNF/geoportal-sdk.git", | ||
"type" : "git" | ||
}, | ||
"author" : "IGNF", | ||
"bugs" : { | ||
"url" : "https://github.com/IGNF/geoportal-sdk/issues" | ||
}, | ||
"license" : "CECILL-B", | ||
"name" : "@ignf-geoportal/sdk-2d", | ||
"description" : "French Geoportal SDK based on OpenLayers (2D)", | ||
"date" : "04/08/2023", | ||
"scripts" : {}, | ||
"module" : "src/SDK2D.js", | ||
"author" : "IGNF", | ||
"homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/sdk.html", | ||
"files" : [ | ||
"dist/", | ||
"src/", | ||
"LICENCE.md", | ||
"README.md", | ||
"package.json" | ||
], | ||
"module" : "src/SDK2D.js", | ||
"date" : "07/06/2023", | ||
"name" : "@ignf-geoportal/sdk-2d", | ||
"directories" : {}, | ||
"main" : "dist/GpSDK2D-src.js", | ||
"keywords" : [ | ||
"openlayers", | ||
"geoportail", | ||
"webservice", | ||
"javascript" | ||
], | ||
"dependencies" : { | ||
"xmldom" : "^0.1.27", | ||
"ol" : "6.9.0", | ||
"geoportal-extensions-openlayers" : "3.3.3", | ||
"node-fetch" : "^2.6.1", | ||
"geoportal-extensions-openlayers" : "3.3.1" | ||
"xmldom" : "^0.1.27", | ||
"ol" : "6.9.0" | ||
}, | ||
"license" : "CECILL-B", | ||
"version" : "3.4.2", | ||
"repository" : { | ||
"type" : "git", | ||
"url" : "https://github.com/IGNF/geoportal-sdk.git" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,42 +1,42 @@ | ||
{ | ||
"name" : "@ignf-geoportal/sdk-3d", | ||
"homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/sdk.html", | ||
"dependencies" : { | ||
"ol" : "6.9.0", | ||
"geoportal-extensions-openlayers" : "3.3.1", | ||
"itowns" : "2.38.2", | ||
"geoportal-extensions-itowns" : "2.4.1", | ||
"node-fetch" : "^2.6.1", | ||
"xmldom" : "^0.1.27" | ||
}, | ||
"directories" : {}, | ||
"module" : "src/SDK3D.js", | ||
"keywords" : [ | ||
"openlayers", | ||
"itowns", | ||
"geoportail", | ||
"webservice", | ||
"javascript" | ||
], | ||
"scripts" : {}, | ||
"date" : "04/08/2023", | ||
"description" : "French Geoportal SDK based on OpenLayers (2D) and iTowns (3D) libraries", | ||
"main" : "dist/GpSDK3D-src.js", | ||
"author" : "IGNF", | ||
"module" : "src/SDK3D.js", | ||
"directories" : {}, | ||
"license" : "CECILL-B", | ||
"files" : [ | ||
"dist/", | ||
"src/", | ||
"LICENCE.md", | ||
"README.md", | ||
"package.json" | ||
], | ||
"description" : "French Geoportal SDK based on OpenLayers (2D) and iTowns (3D) libraries", | ||
"repository" : { | ||
"type" : "git", | ||
"url" : "https://github.com/IGNF/geoportal-sdk.git" | ||
}, | ||
"version" : "3.4.0", | ||
"scripts" : {}, | ||
"bugs" : { | ||
"url" : "https://github.com/IGNF/geoportal-sdk/issues" | ||
}, | ||
"keywords" : [ | ||
"openlayers", | ||
"itowns", | ||
"geoportail", | ||
"webservice", | ||
"javascript" | ||
], | ||
"license" : "CECILL-B", | ||
"date" : "07/06/2023" | ||
"version" : "3.4.2", | ||
"dependencies" : { | ||
"geoportal-extensions-openlayers" : "3.3.3", | ||
"ol" : "6.9.0", | ||
"node-fetch" : "^2.6.1", | ||
"geoportal-extensions-itowns" : "2.4.3", | ||
"itowns" : "2.38.2", | ||
"xmldom" : "^0.1.27" | ||
}, | ||
"name" : "@ignf-geoportal/sdk-3d", | ||
"repository" : { | ||
"url" : "https://github.com/IGNF/geoportal-sdk.git", | ||
"type" : "git" | ||
}, | ||
"author" : "IGNF", | ||
"homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/sdk.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
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