Skip to content

Commit

Permalink
feat(demo): add an demo context to explain how add layer from index file
Browse files Browse the repository at this point in the history
  • Loading branch information
pelord committed Jun 14, 2023
1 parent 7f290c1 commit ced0f16
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"regex": {
"geoservice": [
{
"url": "https://servicesmatriciels.mern.qc/erdas-iws/ogc/wms/.*",
"url": "https:\/\/geoegl.msp.gouv.qc.ca\/ws\/mffpecofor.fcgi",
"type": "wms",
"propertiesForLayerName": ["nom_couche_service", "nom_mosaique_wms", "wmsName"]
"propertiesForLayerName": ["name"]
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions src/contexts/_contexts.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@
{
"uri": "geolocation",
"title": "Geolocation"
},
{
"uri": "addLayerFromIndex",
"title": "Ajout de couche à partir d'un index"
}
]
26 changes: 26 additions & 0 deletions src/contexts/addLayerFromIndex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"uri": "addLayerFromIndex",
"base": "_base",
"layers": [
{
"title": "Index",
"id": "wmsIndex",
"sourceOptions": {
"type": "vector",
"url": "/data/wmsIndex.geojson",
"queryable": true,
"queryTitle": "Nom de la couche: ${name}"
},
"messages": [
{
"text": "messages.addLayerFromIndex",
"type": "success",
"options": {
"tapToDismiss": false,
"timeOut": 0
}
}
]
}
]
}
9 changes: 9 additions & 0 deletions src/data/wmsIndex.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "FeatureCollection",
"name": "wmsIndex",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "url": "https:\/\/geoegl.msp.gouv.qc.ca\/ws\/mffpecofor.fcgi", "name": "lsat_mos2012" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -79.33301, 53.432568 ], [ -78.595951, 52.011097 ], [ -79.648892, 51.326685 ], [ -79.569921, 47.009624 ], [ -76.279479, 45.403888 ], [ -74.568449, 44.982712 ], [ -71.383301, 44.877417 ], [ -70.435653, 45.377565 ], [ -69.251094, 47.299183 ], [ -68.2508, 47.483448 ], [ -67.171535, 47.851977 ], [ -65.72374, 47.851977 ], [ -61.801533, 46.667418 ], [ -60.195797, 47.746683 ], [ -60.406385, 48.825948 ], [ -56.931678, 51.353008 ], [ -56.931678, 52.116391 ], [ -58.247855, 52.827126 ], [ -59.879914, 52.774479 ], [ -60.932856, 52.40595 ], [ -62.538592, 52.985067 ], [ -63.407269, 52.985067 ], [ -64.328592, 52.748156 ], [ -64.354916, 51.826832 ], [ -65.091975, 52.40595 ], [ -65.881681, 52.116391 ], [ -66.197564, 52.93242 ], [ -66.855652, 53.432568 ], [ -67.566388, 53.985362 ], [ -67.566388, 53.985362 ], [ -73.489184, 53.932715 ], [ -79.33301, 53.432568 ] ] ] } },
{ "type": "Feature", "properties": { "url": "https:\/\/geoegl.msp.gouv.qc.ca\/ws\/mffpecofor.fcgi", "name": "lsat_mos1986" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -79.385657, 53.406244 ], [ -78.543303, 52.03742 ], [ -79.675216, 51.274037 ], [ -79.543598, 46.90433 ], [ -76.279479, 45.272271 ], [ -74.621096, 44.982712 ], [ -71.435948, 44.877417 ], [ -70.40933, 45.219623 ], [ -69.093153, 47.325507 ], [ -67.197858, 47.825654 ], [ -65.644769, 47.773007 ], [ -61.801533, 46.562124 ], [ -60.037856, 47.667713 ], [ -60.327415, 48.720654 ], [ -56.931678, 51.300361 ], [ -56.80006, 52.116391 ], [ -58.274179, 52.958744 ], [ -60.037856, 52.827126 ], [ -60.880209, 52.48492 ], [ -62.617562, 53.064038 ], [ -64.328592, 52.695509 ], [ -64.354916, 52.011097 ], [ -65.170946, 52.511244 ], [ -66.197564, 52.93242 ], [ -67.487417, 54.064333 ], [ -66.513446, 54.906686 ], [ -63.617857, 54.56448 ], [ -63.065063, 55.45948 ], [ -63.354622, 58.828893 ], [ -64.644475, 60.460952 ], [ -66.17124, 58.960511 ], [ -67.934917, 58.644628 ], [ -69.198447, 59.302717 ], [ -69.461683, 60.224041 ], [ -69.119477, 60.803158 ], [ -69.409035, 61.276982 ], [ -71.462271, 61.303306 ], [ -71.462271, 61.645512 ], [ -73.857714, 62.619483 ], [ -78.227421, 62.566836 ], [ -78.332715, 60.934776 ], [ -77.70095, 59.855511 ], [ -78.780215, 58.88154 ], [ -77.121832, 57.696981 ], [ -76.595362, 56.775657 ], [ -76.990215, 55.801686 ], [ -78.411686, 55.117274 ], [ -79.517274, 54.801392 ], [ -79.885804, 54.669774 ], [ -79.885804, 54.669774 ], [ -79.385657, 53.406244 ] ] ] } }
]
}
3 changes: 2 additions & 1 deletion src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"messages": {
"title": "Title from a translation.",
"message": "Message from a translation - no icon - <div class='toast-message-green-div'>Message at the context level </div>Open the layer 'MSP Tel. Urgence' to see messages at the layer level. {{content}}",
"content": "Dynamic content can also be added to the message"
"content": "Dynamic content can also be added to the message",
"addLayerFromIndex": "You must configure the configuration files ( <a href='https://github.com/infra-geo-ouverte/igo2/blob/master/src/config/config.json' target='_blank'>config.json</a> OU <a href='https://github.com/infra-geo-ouverte/igo2/blob/master/src/environments/environment.ts' target='_blank'>environnement.ts</a>) in order to be able to detect entities of type geoservice (wms)"
}
}
3 changes: 2 additions & 1 deletion src/locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
"messages": {
"title": "Titre provenant d'une traduction.",
"message": "Message provenant d'une traduction - **Config sans icône- <div class='toast-message-green-div'>Message provenant du contexte</div>Ouvrez lea couche 'MSP Tel. Urgence' pour voir les messages liés. {{content}}",
"content": "Du contenu dynamique peut également être ajouté au message"
"content": "Du contenu dynamique peut également être ajouté au message",
"addLayerFromIndex": "Vous devez configurer les fichiers de configuration ( <a href='https://github.com/infra-geo-ouverte/igo2/blob/master/src/config/config.json' target='_blank'>config.json</a> OU <a href='https://github.com/infra-geo-ouverte/igo2/blob/master/src/environments/environment.ts' target='_blank'>environnement.ts</a>) afin d'être en mesure de détecter les entités de type geoservice (wms)"
}
}

0 comments on commit ced0f16

Please sign in to comment.