forked from mviewer/mviewer
-
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.
* Init mviewer draw tool New js file 'draw.js', New xml file 'draw.xml', add some change on different file like 'mviewer.js', 'index.html' and 'mviewer.css' Mise à jour de l'outil (Fenêtre, repère et polygone unique, suppression mode dessin...) Modification du style de la fenêtre create and style median point * Correction of the style of each feature * Add a new value to the drawing window * Ajout de l'export au format GeoJSON * Change tooltip management set possible geometry type in configuration for lineString add snapping beetween first and last point to create a polygon if wanted set the possibility to draw one feature by one feature or serveral at the same time * snap with bbox strategy, pretty, fix info * Fix customlayer example * use snappingLayerUrl and snappingLimitZoom * Tools and Draw tool doc * correction after test * change snap level * revert modification on export * change tooltip position * update mviewer after meeting I18n for message and button Add tolerance for snapping Add help message in panel Add delete on right click when drawing * Prettier * draw : line, stroke colors params * draw : line, stroke colors params * Change HTML string array to templateString * Fix tooltip and input string sync on feature selct * Fix : deleting commas after each div button of buttonOptions * Fix syntaxe * Fix modify on reactivate tool * Lint file * Update window style of drawtool * doc snapTolerance param --------- Co-authored-by: raphael-dsc <[email protected]> Co-authored-by: Pierre Jégo <[email protected]> Co-authored-by: Agath21 <[email protected]>
- Loading branch information
1 parent
0489c35
commit 6074d47
Showing
11 changed files
with
1,416 additions
and
389 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
mviewer.customLayers.parcelles = {}; | ||
mviewer.customLayers.parcelles.layer = new ol.layer.Vector({ | ||
source: new ol.source.Vector({ | ||
url: (extent) => { | ||
const baseUrl = | ||
"https://www.geo2france.fr/geoserver/pci/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=pci%3Ageo_parcelle_2023&outputFormat=application%2Fjson"; | ||
return `${baseUrl}&bbox=${extent}`; | ||
}, | ||
format: new ol.format.GeoJSON(), | ||
strategy: ol.loadingstrategy.bbox, | ||
}), | ||
style: new ol.style.Style({ | ||
stroke: new ol.style.Stroke({ | ||
color: "rgba(46,83,103,0.6)", | ||
width: 1, | ||
}), | ||
fill: new ol.style.Fill({ | ||
color: "rgba(0, 0, 0, 0)", | ||
}), | ||
}), | ||
}); | ||
mviewer.customLayers.parcelles.handle = false; | ||
} |
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,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config> | ||
<application lang="fr" title="Mviewer" mouseposition="false" logo="" help="mviewer_help.html" drawtools="true" measuretools="true" mapprint="true" exportpng="true" style="css/themes/wet_asphalt.css" togglealllayersfromtheme="true"/> | ||
<tools> | ||
<draw geometryTypes="Polygon" help="true" pointFill="rgba(255, 255, 255, 0.4)" pointStroke="#131c94" lineStroke="#6342f5" snapLimitZoom="17" snapTolerance="10" snapLayerUrl="https://www.geo2france.fr/geoserver/pci/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=pci%3Ageo_parcelle_2023&outputFormat=application%2Fjson"/> | ||
</tools> | ||
<mapoptions maxzoom="19" projection="EPSG:3857" center="255919,6427622" zoom="16" projextent="-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244" /> | ||
|
||
<baselayers style="gallery"> | ||
<baselayer type="WMTS" id="ortho" label="Photo aérienne IGN" title="GéoPortail" maxscale="1000" thumbgallery="img/basemap/ortho.jpg" | ||
url="https://data.geopf.fr/wmts" layers="ORTHOIMAGERY.ORTHOPHOTOS" format="image/jpeg" visible="false" fromcapacity="false" | ||
attribution="<a href='https://geoservices.ign.fr/services-geoplateforme-diffusion' target='_blank'><img src='img/basemap/geoservices.png'></a>" style="normal" matrixset="PM" maxzoom="22"/> | ||
<baselayer type="WMS" id="osm" label="OpenStreetMap" title="Plan OSM Géobretagne" thumbgallery="img/basemap/osm.png" | ||
url="https://tile.geobretagne.fr/osm/service" layers="osm:grey" format="image/png" visible="true" | ||
attribution="GéoBretagne. Données : les contributeurs d'<a href='https://www.openstreetmap.org/' target='_blank'>OpenStreetMap </a>, <a href='https://www.openstreetmap.org/copyright' target='_blank'>ODbL </a>" /> | ||
<baselayer type="WMS" id="cadastre" label="Cadastre" title="Plan cadastrapp" thumbgallery="img/basemap/osm.png" | ||
url="https://www.geo2france.fr/geoserver/pci/ows" layers="pci:cadastre" format="image/png" visible="true" | ||
attribution="GéoBretagne. Données : les contributeurs d'<a href='https://www.openstreetmap.org/' target='_blank'>OpenStreetMap </a>, <a href='https://www.openstreetmap.org/copyright' target='_blank'>ODbL </a>" /> | ||
|
||
</baselayers> | ||
<proxy url=""/> | ||
<!-- <olscompletion url="https://api-adresse.data.gouv.fr/search/" type="ban" attribution="La recherche d'adresse est un service proposé par la BAN"/> --> | ||
<olscompletion url="https://data.geopf.fr/geocodage/completion" type="ign" attribution="IGN"/> | ||
|
||
<searchparameters bbox="false" localities="true" features="false" /> | ||
|
||
<themes> | ||
<theme name="Cadastre" collapsed="false" id="habitant" icon="fas fa-users"> | ||
<layer id="geo_parcelle_2023" name="geo_parcelle_2023" visible="true" tiled="true" | ||
queryable="false" | ||
infoformat="application/vnd.ogc.gml" featurecount="20" | ||
url="https://www.geo2france.fr/geoserver/pci/wms" | ||
attribution="PCI Géo2France" | ||
> | ||
</layer> | ||
</theme> | ||
</themes> | ||
</config> |
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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config> | ||
<application lang="fr" title="Mviewer" mouseposition="false" logo="" help="mviewer_help.html" drawtools="true" measuretools="true" mapprint="true" exportpng="true" style="css/themes/wet_asphalt.css" togglealllayersfromtheme="true"/> | ||
<tools> | ||
<draw help="true" geometryStroke="#2e5367" singleDraw="true" nbPixelsToClosePolygon="10"/> | ||
</tools> | ||
<mapoptions maxzoom="19" projection="EPSG:3857" center="255919,6427622" zoom="16" projextent="-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244" /> | ||
|
||
<baselayers style="gallery"> | ||
<baselayer type="WMTS" id="ortho" label="Photo aérienne IGN" title="GéoPortail" maxscale="1000" thumbgallery="img/basemap/ortho.jpg" | ||
url="https://data.geopf.fr/wmts" layers="ORTHOIMAGERY.ORTHOPHOTOS" format="image/jpeg" visible="false" fromcapacity="false" | ||
attribution="<a href='https://geoservices.ign.fr/services-geoplateforme-diffusion' target='_blank'><img src='img/basemap/geoservices.png'></a>" style="normal" matrixset="PM" maxzoom="22"/> | ||
<baselayer type="WMS" id="osm" label="OpenStreetMap" title="Plan OSM Géobretagne" thumbgallery="img/basemap/osm.png" | ||
url="https://tile.geobretagne.fr/osm/service" layers="osm:grey" format="image/png" visible="true" | ||
attribution="GéoBretagne. Données : les contributeurs d'<a href='https://www.openstreetmap.org/' target='_blank'>OpenStreetMap </a>, <a href='https://www.openstreetmap.org/copyright' target='_blank'>ODbL </a>" /> | ||
<baselayer type="WMS" id="cadastre" label="Cadastre" title="Plan cadastrapp" thumbgallery="img/basemap/osm.png" | ||
url="https://www.geo2france.fr/geoserver/pci/ows" layers="pci:cadastre" format="image/png" visible="true" | ||
attribution="GéoBretagne. Données : les contributeurs d'<a href='https://www.openstreetmap.org/' target='_blank'>OpenStreetMap </a>, <a href='https://www.openstreetmap.org/copyright' target='_blank'>ODbL </a>" /> | ||
|
||
</baselayers> | ||
<proxy url=""/> | ||
<!-- <olscompletion url="https://api-adresse.data.gouv.fr/search/" type="ban" attribution="La recherche d'adresse est un service proposé par la BAN"/> --> | ||
<olscompletion url="https://data.geopf.fr/geocodage/completion" type="ign" attribution="IGN"/> | ||
|
||
<searchparameters bbox="false" localities="true" features="false" /> | ||
|
||
<themes> | ||
<theme name="Cadastre" collapsed="false" id="habitant" icon="fas fa-users"> | ||
<layer id="geo_parcelle_2023 " name="Parcelle" visible="true" tiled="false" | ||
searchable="false" queryable="true" | ||
url="https://www.geo2france.fr/geoserver/pci/ows"> | ||
</layer> | ||
</theme> | ||
</themes> | ||
</config> |
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,67 @@ | ||
.. Authors : | ||
.. mviewer team | ||
.. _tools: | ||
|
||
Présentation | ||
============ | ||
|
||
Cette page vous servira à comprendre comment utiliser les outils disponibles. | ||
Les outils sont intégrées dans le coeur mviewer et utilisés selon la configuration du XML. Le fichier est chargé dans tous les cas. | ||
|
||
La différence avec les extensions est qu'une extension (et ses fichiers) est chargée au besoin et selon qu'elle est utilisée ou non dans la configuration XML. | ||
|
||
Les outils concerne ici : | ||
|
||
- l'outil de dessin | ||
|
||
D'autres outils viendront compléter cette liste. | ||
|
||
Les outils sont localisés dans la balise <tools> de la configuration XML. | ||
|
||
.. code-block:: xml | ||
:linenos: | ||
<application> | ||
<tools> | ||
... outils | ||
</tools> | ||
....reste de la configuration XML | ||
</application> | ||
Les outils sont présentés dans les sections qui suivent. | ||
|
||
Outil de dessin | ||
--------------- | ||
|
||
L'outil de dessin permet de : | ||
|
||
- dessiner un point | ||
- dessiner un polygon | ||
- dessiner une ligne | ||
- donner un nom à une forme | ||
- exporter le dessin en GeoJSON | ||
- afficher des informations de mesure | ||
- dessiner selon une couche d'accroche WFS (snapping) | ||
|
||
Pour activer l'outil, vous devez le rajouter dans la balise ``<tools>`` : | ||
|
||
.. code-block:: xml | ||
:linenos: | ||
<tools> | ||
<draw geometryTypes="Polygon" snapLayerId="geom_parcelle_2023" ... /> | ||
</tools> | ||
** Paramètres ** | ||
|
||
* ``geometryTypes`` : (string) - List des géométries à dessiner. | ||
* ``snapLayerId`` : (string) - Un ID de couche WFS déjà utilisé dans la configuration XML (e.g custom layer) | ||
* ``snapLayerUrl`` : (string) - URL complète d'une couche WFS (le format doit être en ``application/json`` ) | ||
* ``snapLimitZoom`` : (int) - Limite l'activation du snapping par niveau de zoom. Cela permet de limiter le chargement d'entités WFS. Le snapping sera actif si le zoom de la carte est supérieur à cette valeur. | ||
* ``help`` : (boolean) - Utilsier l'aide | ||
* ``nbPixelsToClosePolygon`` : (int) - Distance en pixels pour fermer automatiquement la forme et créer un polygone. | ||
* ``singleDraw`` : (boolen) - True pour dessiner uniquement une forme à la fois. | ||
* ``snapTolerance`` : (int) - Tolérence du snapping en pixel (c.fg pixelTolerance ol > v8.0) | ||
|
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.