-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout du DSFR sur le gestionnaire de couches (#32)
+ Positionnement des widgets + Ajout demo et exemple en mode ES module + Header du panneau optionnel + Ajout du bouton Extent + Ajustement sur l'utilisation des layers hors Gp
- Loading branch information
1 parent
49abce7
commit a7a3011
Showing
54 changed files
with
2,614 additions
and
627 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
*.tsbuildinfo |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/x-icon" href="https://openlayers.org/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Using OpenLayers with Vite</title> | ||
</head> | ||
<body> | ||
<header> | ||
<img src="./esmodule.png" class="logo" /> | ||
</header> | ||
<main> | ||
<div id="map"></div> | ||
<script type="module" src="./main.js"></script> | ||
</main> | ||
</body> | ||
</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,131 @@ | ||
import "./style.css"; | ||
import { | ||
Map, | ||
View | ||
} from "ol"; | ||
import TileLayer from "ol/layer/Tile"; | ||
import OSM from "ol/source/OSM"; | ||
|
||
import { | ||
Drawing, | ||
Isocurve, | ||
Route, | ||
LayerImport, | ||
GeoportalAttribution, | ||
ElevationPath, | ||
MeasureArea, | ||
MeasureAzimuth, | ||
MeasureLength, | ||
LayerSwitcher, | ||
MousePosition as GeoportalMousePosition, | ||
ReverseGeocode, | ||
SearchEngine, | ||
GetFeatureInfo, | ||
CRS, | ||
LayerMapBox as GeoportalLayerMapBox, | ||
LayerWMTS as GeoportalLayerWMTS | ||
} from "geoportal-extensions-openlayers"; | ||
|
||
import Gp from "geoportal-access-lib"; | ||
|
||
var cfg = new Gp.Services.Config({ | ||
customConfigFile : "https://raw.githubusercontent.com/IGNF/geoportal-configuration/new-url/dist/fullConfig.json", | ||
onSuccess : () => { | ||
CRS.load(); | ||
|
||
const map = new Map({ | ||
target : "map", | ||
layers : [ | ||
new TileLayer({ | ||
source : new OSM() | ||
}), | ||
new GeoportalLayerMapBox({ | ||
layer : "PLAN.IGN" | ||
}), | ||
new GeoportalLayerWMTS({ | ||
layer : "ORTHOIMAGERY.ORTHOPHOTOS" | ||
}) | ||
], | ||
view : new View({ | ||
center : [288074.8449901076, 6247982.515792289], | ||
zoom : 8, | ||
}) | ||
}); | ||
|
||
var drawing = new Drawing({ | ||
position : "bottom-right" | ||
}); | ||
map.addControl(drawing); | ||
|
||
var iso = new Isocurve({ | ||
position : "bottom-left" | ||
}); | ||
map.addControl(iso); | ||
|
||
var layerImport = new LayerImport({ | ||
position : "bottom-left" | ||
}); | ||
map.addControl(layerImport); | ||
|
||
var layerSwitcher = new LayerSwitcher({ | ||
options : { | ||
position : "top-right" | ||
} | ||
}); | ||
map.addControl(layerSwitcher); | ||
|
||
var mp = new GeoportalMousePosition({ | ||
position : "top-right" | ||
}); | ||
map.addControl(mp); | ||
|
||
var route = new Route({ | ||
position : "top-right" | ||
}); | ||
map.addControl(route); | ||
|
||
var reverse = new ReverseGeocode({ | ||
position : "top-right" | ||
}); | ||
map.addControl(reverse); | ||
|
||
var search = new SearchEngine({ | ||
position : "top-right" | ||
}); | ||
map.addControl(search); | ||
|
||
var feature = new GetFeatureInfo({ | ||
options : { | ||
position : "top-right" | ||
} | ||
}); | ||
map.addControl(feature); | ||
|
||
var measureLength = new MeasureLength({ | ||
position : "bottom-left" | ||
}); | ||
map.addControl(measureLength); | ||
|
||
var measureArea = new MeasureArea({ | ||
position : "bottom-left" | ||
}); | ||
map.addControl(measureArea); | ||
|
||
var measureAzimuth = new MeasureAzimuth({ | ||
position : "bottom-left" | ||
}); | ||
map.addControl(measureAzimuth); | ||
|
||
var measureProfil = new ElevationPath({ | ||
position : "bottom-left" | ||
}); | ||
map.addControl(measureProfil); | ||
|
||
var attributions = new GeoportalAttribution(); | ||
map.addControl(attributions); | ||
}, | ||
onFailure : (e) => { | ||
console.error(e); | ||
} | ||
}); | ||
cfg.call(); |
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,16 @@ | ||
{ | ||
"name": "my-app", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"serve": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"vite": "^5.2.11" | ||
}, | ||
"dependencies": { | ||
"geoportal-extensions-openlayers": "../../dist/package/geoportal-extensions-openlayers.tgz", | ||
"ol": "latest" | ||
} | ||
} |
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,18 @@ | ||
# OpenLayers + Vite | ||
|
||
This example demonstrates how the `ol` package can be used with [Vite](https://vitejs.dev/). | ||
|
||
To get started, run the following (requires Node 14+): | ||
|
||
npx create-ol-app my-app --template vite | ||
|
||
Then change into your new `my-app` directory and start a development server (available at http://localhost:5173): | ||
|
||
cd my-app | ||
npm run dev | ||
|
||
To generate a build ready for production: | ||
|
||
npm run build | ||
|
||
Then deploy the contents of the `dist` directory to your server. You can also run `npm run serve` to serve the results of the `dist` directory for preview. |
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,28 @@ | ||
@import "node_modules/ol/ol.css"; | ||
@import "node_modules/geoportal-extensions-openlayers/css/Classic.css"; | ||
|
||
html, body { | ||
margin: 0; | ||
height: 100%; | ||
} | ||
header { | ||
display: flex; | ||
place-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.logo { | ||
margin: 0 2rem 0 0; | ||
} | ||
|
||
header .wrapper { | ||
display: flex; | ||
place-items: flex-start; | ||
flex-wrap: wrap; | ||
} | ||
|
||
#map { | ||
position: absolute; | ||
height: 500px; | ||
width: 100%; | ||
} |
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 @@ | ||
export default { | ||
build : { | ||
sourcemap : true, | ||
} | ||
}; |
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
Oops, something went wrong.