diff --git a/build/widgets.json b/build/widgets.json index 8e20658..18bcbce 100644 --- a/build/widgets.json +++ b/build/widgets.json @@ -14,6 +14,11 @@ "node_modules/geoportal-extensions-openlayers/src/packages/Controls/ReverseGeocode/ReverseGeocode.js", "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Measures/MeasureArea.js", "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Measures/MeasureLength.js", - "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Measures/MeasureAzimuth.js" + "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Measures/MeasureAzimuth.js", + "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Catalog/Catalog.js", + "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Legends/Legends.js", + "node_modules/geoportal-extensions-openlayers/src/packages/Controls/OverviewMap/GeoportalOverviewMap.js", + "node_modules/geoportal-extensions-openlayers/src/packages/Controls/FullScreen/GeoportalFullScreen.js", + "node_modules/geoportal-extensions-openlayers/src/packages/Controls/Zoom/GeoportalZoom.js" ] } \ No newline at end of file diff --git a/geopf-extensions-openlayers-1.0.0-beta.0-165.tgz b/geopf-extensions-openlayers-1.0.0-beta.0-165.tgz new file mode 100644 index 0000000..22c3c70 Binary files /dev/null and b/geopf-extensions-openlayers-1.0.0-beta.0-165.tgz differ diff --git a/geoportal-extensions-openlayers-1.0.0-beta.12.tgz b/geoportal-extensions-openlayers-1.0.0-beta.12.tgz deleted file mode 100644 index 2f64610..0000000 Binary files a/geoportal-extensions-openlayers-1.0.0-beta.12.tgz and /dev/null differ diff --git a/package.json b/package.json index a081e24..1bb7417 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@gouvfr/dsfr": "^1.11.0", "file-saver": "^2.0.5", "geoportal-access-lib": "3.4.0", - "geoportal-extensions-openlayers": "./geoportal-extensions-openlayers-1.0.0-beta.12.tgz", + "geoportal-extensions-openlayers": "./geopf-extensions-openlayers-1.0.0-beta.0-165.tgz", "ol": "8.2.0" }, "devDependencies": { diff --git a/src/components/TheThematic.vue b/src/components/TheThematic.vue index ba98c57..3e9a983 100644 --- a/src/components/TheThematic.vue +++ b/src/components/TheThematic.vue @@ -20,7 +20,7 @@ export default { beforeMount() { // INFO // l'opération d'ajout des tags link pour les thémes est realisée par webpack (cf. vue.config.js) : - // + // // // idem pour les css di DSFR ! }, diff --git a/src/config.js b/src/config.js index a51fbaa..b0345ad 100644 --- a/src/config.js +++ b/src/config.js @@ -9,19 +9,19 @@ var apiKey = "full"; */ var project = { sourceProject : "https://github.com/IGNF/geoportal-extensions-openlayers-samples", - sourceExtensions: "https://ignf.github.io/geoportal-extensions-openlayers", - jsdoc: "https://ignf.github.io/geoportal-extensions-openlayers/current/jsdoc/", + sourceExtensions: "https://ignf.github.io/geopf-extensions-openlayers", + jsdoc: "https://ignf.github.io/geopf-extensions-openlayers/jsdoc/", library: { name: "OpenLayers", url: "https://openlayers.org/", logo: "./assets/logo-openlayers.png", dist: { - js: "https://raw.githubusercontent.com/IGNF/geoportal-extensions-openlayers/master/samples-src/resources/vendor/ol/v6.9.0/ol.js", - css: "https://raw.githubusercontent.com/IGNF/geoportal-extensions-openlayers/master/samples-src/resources/vendor/ol/v6.9.0/ol.css" + js: "https://raw.githubusercontent.com/IGNF/geopf-extensions-openlayers/refs/heads/main/samples-src/resources/vendor/ol/v8.2.0/ol.js", + css: "https://raw.githubusercontent.com/IGNF/geopf-extensions-openlayers/refs/heads/main/samples-src/resources/vendor/ol/v8.2.0/ol.css" }, plugin: { - js: "https://ignf.github.io/geoportal-extensions-openlayers/latest/dist/Widgets.js", - css: "https://ignf.github.io/geoportal-extensions-openlayers/latest/dist/Widgets.css" + js: "https://raw.githubusercontent.com/IGNF/geopf-extensions-openlayers/refs/heads/gh-pages/dist/bundle/GpfExtOL.js", + css: "https://raw.githubusercontent.com/IGNF/geopf-extensions-openlayers/refs/heads/gh-pages/dist/bundle/Dsfr.css" } } }; diff --git a/src/data/openlayers-catalog.doclet.json b/src/data/openlayers-catalog.doclet.json new file mode 100644 index 0000000..87dbe37 --- /dev/null +++ b/src/data/openlayers-catalog.doclet.json @@ -0,0 +1 @@ +{"name":"catalog","auto":true,"params":[{"type":{"names":["Object"]},"description":"options for function call.","name":"options","value":null,"section":true}],"examples":["var widget = new ol.control.Catalog({\n collapsed : true,\n draggable : false,\n titlePrimary : \"\",\n titleSecondary : \"Gérer vos couches de données\",\n layerLabel : \"title\",\n layerFilter : [],\n search : {\n display : true, \n criteria : [\n \"name\",\n \"title\",\n \"description\"\n ]\n },\n addToMap : true,\n categories : [\n {\n title : \"Données\",\n id : \"data\",\n default : true,\n filter : null\n // sous categories\n // items : [\n // {\n // title : \"\",\n // default : true,\n // filter : {\n // field : \"\",\n // value : \"\"\n // }\n // }\n // ]\n }\n ],\n configuration : {\n type : \"json\", // type:\"service\"\n urls : [ // data:{}\n \"https://raw.githubusercontent.com/IGNF/cartes.gouv.fr-entree-carto/main/public/data/layers.json\",\n \"https://raw.githubusercontent.com/IGNF/cartes.gouv.fr-entree-carto/main/public/data/edito.json\"\n ]\n }\n});\nwidget.on(\"catalog:loaded\", (e) => { console.log(e.data); });\nwidget.on(\"catalog:layer:add\", (e) => { console.log(e); });\nwidget.on(\"catalog:layer:remove\", (e) => { console.log(e); });\nmap.addControl(widget);"]} \ No newline at end of file diff --git a/src/data/openlayers-geoportalfullscreen.doclet.json b/src/data/openlayers-geoportalfullscreen.doclet.json new file mode 100644 index 0000000..b87bc03 --- /dev/null +++ b/src/data/openlayers-geoportalfullscreen.doclet.json @@ -0,0 +1 @@ +{"name":"geoportalfullscreen","auto":true,"params":[{"type":{"names":["Object"]},"description":"ol.control.FullScreen options (see {@link http://openlayers.org/en/latest/apidoc/ol.control.FullScreen.html ol.Control.FullScreen})","name":"options","value":null,"section":true}],"examples":["var zoom = new ol.control.GeoportalFullScreen({\n position: \"top-left\"\n});\nmap.addControl(zoom);"]} \ No newline at end of file diff --git a/src/data/openlayers-geoportaloverviewmap.doclet.json b/src/data/openlayers-geoportaloverviewmap.doclet.json new file mode 100644 index 0000000..2850352 --- /dev/null +++ b/src/data/openlayers-geoportaloverviewmap.doclet.json @@ -0,0 +1 @@ +{"name":"geoportaloverviewmap","auto":true,"params":[{"type":{"names":["Object"]},"description":"ol.control.OverviewMap options (see {@link http://openlayers.org/en/latest/apidoc/ol.control.OverviewMap.html ol.Control.OverviewMap})","name":"options","value":null,"section":true}],"examples":["var overviewmap = new ol.control.GeoportalOverviewMap({\n position: \"top-left\"\n});\nmap.addControl(overviewmap);"]} \ No newline at end of file diff --git a/src/data/openlayers-geoportalzoom.doclet.json b/src/data/openlayers-geoportalzoom.doclet.json new file mode 100644 index 0000000..314306f --- /dev/null +++ b/src/data/openlayers-geoportalzoom.doclet.json @@ -0,0 +1 @@ +{"name":"geoportalzoom","auto":true,"params":[{"type":{"names":["Object"]},"description":"ol.control.Zoom options (see {@link http://openlayers.org/en/latest/apidoc/ol.control.Zoom.html ol.Control.Zoom})","name":"options","value":null,"section":true}],"examples":["var zoom = new ol.control.GeoportalZoom({\n position: \"top-left\"\n});\nmap.addControl(zoom);"]} \ No newline at end of file diff --git a/src/data/openlayers-layerswitcher.doclet.json b/src/data/openlayers-layerswitcher.doclet.json index 0d7079a..95ec08d 100644 --- a/src/data/openlayers-layerswitcher.doclet.json +++ b/src/data/openlayers-layerswitcher.doclet.json @@ -1 +1 @@ -{"name":"layerswitcher","auto":true,"params":[{"type":{"names":["Object"]},"description":"control options","name":"options","value":null,"section":true},{"type":{"names":["Array"]},"optional":true,"description":"list of layers to be configured. Each array element is an object, with following properties :","name":"options.layers","value":null,"section":true},{"type":{"names":["ol.layer.Layer"]},"optional":true,"description":"ol.layer.Layer layer to be configured (that has been added to map)","name":"options.layers.layer","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties :","name":"options.layers.config","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"description":"layer alias, to be displayed in widget layer list. E.g. : \"Cartes IGN\"","name":"options.layers.config.title","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"layer description, to be displayed on title hover, or in layer information panel.","name":"options.layers.config.description","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"link to a quick look image for this layer.","name":"options.layers.config.quicklookUrl","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"array of layer legends. Each array element is an object, with following properties :\n - url (String, mandatory) : link to a legend\n - minScaleDenominator (Number, optional) : min scale denominator for legend validity.","name":"options.layers.config.legends","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata","name":"options.layers.config.metadata","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"ol.control.Control options (see {@link http://openlayers.org/en/latest/apidoc/ol.control.Control.html ol.control.Control})","name":"options.options","value":null,"section":true},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"Specify if widget has to be collapsed (true) or not (false) on map loading. Default is true.","name":"options.options.collapsed","value":null,"section":false}],"examples":["map.addControl(new ol.control.LayerSwitcher(\n [\n {\n layer : wms1,\n config : {\n title : \"test layer name 1\",\n description : \"test layer desc 1\",\n }\n }\n ],\n {\n collapsed : true\n }\n));"]} \ No newline at end of file +{"name":"layerswitcher","auto":true,"params":[{"type":{"names":["Object"]},"description":"control options","name":"options","value":null,"section":true},{"type":{"names":["Array"]},"optional":true,"description":"list of layers to be configured. Each array element is an object, with following properties :","name":"options.layers","value":null,"section":true},{"type":{"names":["ol.layer.Layer"]},"optional":true,"description":"ol.layer.Layer layer to be configured (that has been added to map)","name":"options.layers.layer","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"custom configuration object for layer information (title, description, legends, metadata, quicklook url), with following properties :","name":"options.layers.config","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"description":"layer alias, to be displayed in widget layer list. E.g. : \"Cartes IGN\"","name":"options.layers.config.title","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"layer description, to be displayed on title hover, or in layer information panel.","name":"options.layers.config.description","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"link to a quick look image for this layer.","name":"options.layers.config.quicklookUrl","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"array of layer legends. Each array element is an object, with following properties :\n - url (String, mandatory) : link to a legend\n - minScaleDenominator (Number, optional) : min scale denominator for legend validity.","name":"options.layers.config.legends","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"array of layer metadata. Each array element is an object, with property url (String, mandatory) : link to a metadata","name":"options.layers.config.metadata","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"ol.control.Control options (see {@link http://openlayers.org/en/latest/apidoc/ol.control.Control.html ol.control.Control})","name":"options.options","value":null,"section":true},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"Specify if widget has to be collapsed (true) or not (false) on map loading. Default is true.","name":"options.options.collapsed","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"Specify if widget has to have a panel header. Default is false.","name":"options.options.panel","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"Specify if widget has to have a counter. Default is false.","name":"options.options.counter","value":null,"section":false}],"examples":["map.addControl(new ol.control.LayerSwitcher(\n [\n {\n layer : wms1,\n config : {\n title : \"test layer name 1\",\n description : \"test layer desc 1\",\n }\n }\n ],\n {\n collapsed : true,\n panel : false,\n counter : false,\n position : \"top-left\"\n }\n));\n\nLayerSwitcher.on(\"layerswitcher:add\", function (e) {\n console.warn(\"layer\", e.layer);\n});\nLayerSwitcher.on(\"layerswitcher:remove\", function (e) {\n console.warn(\"layer\", e.layer);\n});\nLayerSwitcher.on(\"layerswitcher:change:opacity\", function (e) {\n console.warn(\"layer\", e.layer, e.opacity);\n});\nLayerSwitcher.on(\"layerswitcher:change:visibility\", function (e) {\n console.warn(\"layer\", e.layer, e.visibility);\n});"]} \ No newline at end of file diff --git a/src/data/openlayers-legends.doclet.json b/src/data/openlayers-legends.doclet.json new file mode 100644 index 0000000..4e79f7e --- /dev/null +++ b/src/data/openlayers-legends.doclet.json @@ -0,0 +1 @@ +{"name":"legends","auto":true,"params":[{"type":{"names":["Object"]},"description":"options for function call.","name":"options","value":null,"section":true}],"examples":["var legends = new ol.control.Legends();\nmap.addControl(legends);"]} \ No newline at end of file diff --git a/src/data/openlayers-searchengine.doclet.json b/src/data/openlayers-searchengine.doclet.json index f1b6c6a..d3b4da6 100644 --- a/src/data/openlayers-searchengine.doclet.json +++ b/src/data/openlayers-searchengine.doclet.json @@ -1 +1 @@ -{"name":"searchengine","auto":true,"params":[{"type":{"names":["Object"]},"description":"control options","name":"options","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"description":"API key. The key \"calcul\" is used by default.","name":"options.apiKey","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"use of ssl or not (default true, service requested using https protocol)","name":"options.ssl","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"collapse mode, true by default","name":"options.collapsed","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"force control to be never collapsed, false by default.","name":"options.opened","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"defaultvalue":"\"start\"","description":"TODO : position of picto, by default : \"start\"","name":"options.direction","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"Placeholder in search bar. Default is \"Rechercher un lieu, une adresse\".","name":"options.placeholder","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"set a marker on search result, defaults to true.","name":"options.displayMarker","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"defaultvalue":"\"lightOrange\"","description":"Marker style. Currently possible values are \"lightOrange\" (default value), \"darkOrange\", \"red\" and \"turquoiseBlue\".","name":"options.markerStyle","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"False to disable advanced search tools (it will not be displayed). Default is false (not displayed)","name":"options.displayButtonAdvancedSearch","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"False to disable advanced search tools (it will not be displayed). Default is false (not displayed)","name":"options.displayButtonGeolocate","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"False to disable advanced search tools (it will not be displayed). Default is false (not displayed)","name":"options.displayButtonCoordinateSearch","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"False to disable advanced search tools (it will not be displayed). Default is true (displayed)","name":"options.displayButtonClose","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"coordinates search options.","name":"options.coordinateSearch","value":null,"section":true},{"type":{"names":["DOMElement"]},"optional":true,"defaultvalue":null,"description":"TODO : target location of results window. By default under the search bar.","name":"options.coordinateSearch.target","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"list of coordinates units, to be displayed in control units list.\n Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal) for geographical coordinates,\n and \"M\" or \"KM\" for metric coordinates","name":"options.coordinateSearch.units","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"list of projection systems, default are Geographical (\"EPSG:4326\"), Web Mercator (\"EPSG:3857\") and Lambert 93 (\"EPSG:2154\").\n Each array element (=system) is an object with following properties :","name":"options.coordinateSearch.systems","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"description":"Proj4 crs alias (from proj4 defs). e.g. : \"EPSG:4326\". Required","name":"options.coordinateSearch.systems.crs","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"CRS label to be displayed in control. Default is crs code (e.g. \"EPSG:4326\")","name":"options.coordinateSearch.systems.label","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"CRS units type for coordinates conversion : \"Geographical\" or \"Metric\". Default: \"Geographical\"","name":"options.coordinateSearch.systems.type","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"advanced search options for geocoding (filters). Properties can be found among geocode options.filterOptions (see {@link http://ignf.github.io/geoportal-access-lib/latest/jsdoc/module-Services.html#~geocode Gp.Services.geocode})","name":"options.advancedSearch","value":null,"section":true},{"type":{"names":["DOMElement"]},"optional":true,"defaultvalue":null,"description":"TODO : target location of results window. By default under the search bar.","name":"options.advancedSearch.target","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"resources to be used by geocode and autocompletion services :","name":"options.resources","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"defaultvalue":"\"location\"","description":"resources geocoding, by default : \"location\"","name":"options.resources.geocode","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"resources autocompletion, by default : [\"PositionOfInterest\", \"StreetAddress\"]","name":"options.resources.autocomplete","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"false to disable search service, by default : \"false\"","name":"options.resources.search","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options of search service","name":"options.searchOptions","value":null,"section":true},{"type":{"names":["Object"]},"optional":true,"description":"options of search service","name":"options.searchOptions.serviceOptions","value":null,"section":true},{"type":{"names":["Sring"]},"optional":true,"description":"url of service","name":"options.searchOptions.serviceOptions.url","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"index of search, \"standard\" by default","name":"options.searchOptions.serviceOptions.index","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"list of search fields, each field is separated by a comma. \"title,layer_name\" by default","name":"options.searchOptions.serviceOptions.fields","value":null,"section":false},{"type":{"names":["Number"]},"optional":true,"description":"number of response in the service. 1000 by default","name":"options.searchOptions.serviceOptions.size","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"list of search services, each field is separated by a comma. \"WMTS,WMS\" by default","name":"options.searchOptions.serviceOptions.services","value":null,"section":false},{"type":{"names":["Number"]},"optional":true,"description":"number of results in the response. 10 by default","name":"options.searchOptions.serviceOptions.maximumResponses","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options of geocode service (see {@link http://ignf.github.io/geoportal-access-lib/latest/jsdoc/module-Services.html#~geocode Gp.Services.geocode})","name":"options.geocodeOptions","value":null,"section":true},{"type":{"names":["Object"]},"optional":true,"description":"options of geocode service","name":"options.geocodeOptions.serviceOptions","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options of autocomplete service (see {@link http://ignf.github.io/geoportal-access-lib/latest/jsdoc/module-Services.html#~autoComplete Gp.Services.autoComplete})","name":"options.autocompleteOptions","value":null,"section":true},{"type":{"names":["Object"]},"optional":true,"description":"options of autocomplete service","name":"options.autocompleteOptions.serviceOptions","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"trigger a geocoding request if the autocompletion does not return any suggestions, false by default","name":"options.autocompleteOptions.triggerGeocode","value":null,"section":false},{"type":{"names":["Number"]},"optional":true,"defaultvalue":1000,"description":"waiting time before sending the geocoding request, 1000ms by default","name":"options.autocompleteOptions.triggerDelay","value":null,"section":false},{"type":{"names":["Sting","Numeric","function"]},"optional":true,"description":"zoom to results, by default, current zoom.\n Value possible : auto or zoom level.\n Possible to overload it with a function :\n zoomTo : function (info) {\n // do some stuff...\n return zoom;\n }","name":"options.zoomTo","value":null,"section":false}],"examples":["var SearchEngine = ol.control.SearchEngine({\n apiKey : \"CLEAPI\",\n collapsed : true,\n opened : false,\n displayButtonAdvancedSearch : true,\n displayButtonGeolocate : true,\n displayButtonCoordinateSearch : true,\n resources : {\n geocode : [\"StreetAddress\", \"PositionOfInterest\"],\n autocomplete : [\"StreetAddress\"],\n search : false\n },\n advancedSearch : {\n target : document.getElementById(\"dialog\"),\n PositionOfInterest : [{name : \"municipality\", title : \"Ville\"}],\n StreetAddress : [{...}]\n },\n coordinateSearch : {\n target : null\n systems : [\n {\n \"crs\" : \"EPSG:3857\",\n \"label\" : \"Web Mercator\",\n \"type\" : \"Metric\"\n },\n {\n \"crs\" : \"EPSG:4326\",\n \"label\" : \"Géographiques\",\n \"type\" : \"Geographical\"\n }\n ],\n units : [\"DEC\", \"DMS\"]\n },\n geocodeOptions : {},\n autocompleteOptions : {},\n searchOptions : {}\n });\n\n SearchEngine.on(\"searchengine:autocomplete:click\", function (e) {\n console.warn(\"autocomplete\", e.location);\n });\n SearchEngine.on(\"searchengine:search:click\", function (e) {\n console.warn(\"search\", e.suggest);\n });\n SearchEngine.on(\"searchengine:geocode:click\", function (e) {\n console.warn(\"geocode\", e.location);\n });"]} \ No newline at end of file +{"name":"searchengine","auto":true,"params":[{"type":{"names":["Object"]},"description":"control options","name":"options","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"description":"API key. The key \"calcul\" is used by default.","name":"options.apiKey","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"use of ssl or not (default true, service requested using https protocol)","name":"options.ssl","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"collapse mode, true by default","name":"options.collapsed","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"force control to be collapsed or not, true by default.","name":"options.collapsible","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"defaultvalue":"\"start\"","description":"TODO : position of picto, by default : \"start\"","name":"options.direction","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"Placeholder in search bar. Default is \"Rechercher un lieu, une adresse\".","name":"options.placeholder","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"set a marker on search result, defaults to true.","name":"options.displayMarker","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"defaultvalue":"\"lightOrange\"","description":"Marker style. Currently possible values are \"lightOrange\" (default value), \"darkOrange\", \"red\" and \"turquoiseBlue\".","name":"options.markerStyle","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"False to disable advanced search tools (it will not be displayed). Default is false (not displayed)","name":"options.displayButtonAdvancedSearch","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"False to disable advanced search tools (it will not be displayed). Default is false (not displayed)","name":"options.displayButtonGeolocate","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"False to disable advanced search tools (it will not be displayed). Default is false (not displayed)","name":"options.displayButtonCoordinateSearch","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"False to disable advanced search tools (it will not be displayed). Default is true (displayed)","name":"options.displayButtonClose","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"coordinates search options.","name":"options.coordinateSearch","value":null,"section":true},{"type":{"names":["DOMElement"]},"optional":true,"defaultvalue":null,"description":"TODO : target location of results window. By default under the search bar.","name":"options.coordinateSearch.target","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"list of coordinates units, to be displayed in control units list.\n Values may be \"DEC\" (decimal degrees), \"DMS\" (sexagecimal) for geographical coordinates,\n and \"M\" or \"KM\" for metric coordinates","name":"options.coordinateSearch.units","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"list of projection systems, default are Geographical (\"EPSG:4326\"), Web Mercator (\"EPSG:3857\") and Lambert 93 (\"EPSG:2154\").\n Each array element (=system) is an object with following properties :","name":"options.coordinateSearch.systems","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"description":"Proj4 crs alias (from proj4 defs). e.g. : \"EPSG:4326\". Required","name":"options.coordinateSearch.systems.crs","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"CRS label to be displayed in control. Default is crs code (e.g. \"EPSG:4326\")","name":"options.coordinateSearch.systems.label","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"CRS units type for coordinates conversion : \"Geographical\" or \"Metric\". Default: \"Geographical\"","name":"options.coordinateSearch.systems.type","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"advanced search options for geocoding (filters). Properties can be found among geocode options.filterOptions (see {@link http://ignf.github.io/geoportal-access-lib/latest/jsdoc/module-Services.html#~geocode Gp.Services.geocode})","name":"options.advancedSearch","value":null,"section":true},{"type":{"names":["DOMElement"]},"optional":true,"defaultvalue":null,"description":"TODO : target location of results window. By default under the search bar.","name":"options.advancedSearch.target","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"resources to be used by geocode and autocompletion services :","name":"options.resources","value":null,"section":true},{"type":{"names":["String"]},"optional":true,"defaultvalue":"\"location\"","description":"resources geocoding, by default : \"location\"","name":"options.resources.geocode","value":null,"section":false},{"type":{"names":["Array"]},"optional":true,"description":"resources autocompletion, by default : [\"PositionOfInterest\", \"StreetAddress\"]","name":"options.resources.autocomplete","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"false to disable search service, by default : \"false\"","name":"options.resources.search","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options of search service","name":"options.searchOptions","value":null,"section":true},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":true,"description":"add layer automatically to map, defaults to true.","name":"options.searchOptions.addToMap","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"filter on a list of search services, each field is separated by a comma. \"WMTS,TMS\" by default","name":"options.searchOptions.filterServices","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"filter on list of search layers only on service TMS, each field is separated by a comma. \"PLAN.IGN, ...\" by default","name":"options.searchOptions.filterVectortiles","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"updating the list of search layers only on service TMS","name":"options.searchOptions.updateVectortiles","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"description":"options of search service","name":"options.searchOptions.serviceOptions","value":null,"section":true},{"type":{"names":["Sring"]},"optional":true,"description":"url of service","name":"options.searchOptions.serviceOptions.url","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"index of search, \"standard\" by default","name":"options.searchOptions.serviceOptions.index","value":null,"section":false},{"type":{"names":["String"]},"optional":true,"description":"list of search fields, each field is separated by a comma. \"title,layer_name\" by default","name":"options.searchOptions.serviceOptions.fields","value":null,"section":false},{"type":{"names":["Number"]},"optional":true,"description":"number of response in the service. 1000 by default","name":"options.searchOptions.serviceOptions.size","value":null,"section":false},{"type":{"names":["Number"]},"optional":true,"description":"number of results in the response. 10 by default","name":"options.searchOptions.serviceOptions.maximumResponses","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options of geocode service (see {@link http://ignf.github.io/geoportal-access-lib/latest/jsdoc/module-Services.html#~geocode Gp.Services.geocode})","name":"options.geocodeOptions","value":null,"section":true},{"type":{"names":["Object"]},"optional":true,"description":"options of geocode service","name":"options.geocodeOptions.serviceOptions","value":null,"section":false},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options of autocomplete service (see {@link http://ignf.github.io/geoportal-access-lib/latest/jsdoc/module-Services.html#~autoComplete Gp.Services.autoComplete})","name":"options.autocompleteOptions","value":null,"section":true},{"type":{"names":["Object"]},"optional":true,"description":"options of autocomplete service","name":"options.autocompleteOptions.serviceOptions","value":null,"section":false},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"trigger a geocoding request if the autocompletion does not return any suggestions, false by default","name":"options.autocompleteOptions.triggerGeocode","value":null,"section":false},{"type":{"names":["Number"]},"optional":true,"defaultvalue":1000,"description":"waiting time before sending the geocoding request, 1000ms by default","name":"options.autocompleteOptions.triggerDelay","value":null,"section":false},{"type":{"names":["Sting","Numeric","function"]},"optional":true,"description":"zoom to results, by default, current zoom.\n Value possible : auto or zoom level.\n Possible to overload it with a function :\n zoomTo : function (info) {\n // do some stuff...\n return zoom;\n }","name":"options.zoomTo","value":null,"section":false}],"examples":["var SearchEngine = ol.control.SearchEngine({\n apiKey : \"CLEAPI\",\n collapsed : true,\n collapsible : true,\n displayButtonAdvancedSearch : true,\n displayButtonGeolocate : true,\n displayButtonCoordinateSearch : true,\n resources : {\n geocode : [\"StreetAddress\", \"PositionOfInterest\"],\n autocomplete : [\"StreetAddress\"],\n search : false\n },\n advancedSearch : {\n target : document.getElementById(\"dialog\"),\n PositionOfInterest : [{name : \"municipality\", title : \"Ville\"}],\n StreetAddress : [{...}]\n },\n coordinateSearch : {\n target : null\n systems : [\n {\n \"crs\" : \"EPSG:3857\",\n \"label\" : \"Web Mercator\",\n \"type\" : \"Metric\"\n },\n {\n \"crs\" : \"EPSG:4326\",\n \"label\" : \"Géographiques\",\n \"type\" : \"Geographical\"\n }\n ],\n units : [\"DEC\", \"DMS\"]\n },\n geocodeOptions : {},\n autocompleteOptions : {},\n searchOptions : {}\n });\n\n SearchEngine.on(\"searchengine:autocomplete:click\", function (e) {\n console.warn(\"autocomplete\", e.location);\n });\n SearchEngine.on(\"searchengine:search:click\", function (e) {\n console.warn(\"search\", e.suggest);\n });\n SearchEngine.on(\"searchengine:geocode:click\", function (e) {\n console.warn(\"geocode\", e.location);\n });"]} \ No newline at end of file diff --git a/src/map.js b/src/map.js index 60a7f0b..0a757b2 100644 --- a/src/map.js +++ b/src/map.js @@ -21,7 +21,7 @@ import "ol/ol.css"; // import "@gouvfr/dsfr/dist/dsfr.css"; // import "@gouvfr/dsfr/dist/utility/icons/icons.css"; // import "geoportal-extensions-openlayers/css/Dsfr.css"; -// import "geoportal-extensions-openlayers/css/Portail.css"; +// import "geoportal-extensions-openlayers/css/Classic.css"; import { version, @@ -43,7 +43,12 @@ import { ReverseGeocode, SearchEngine, GetFeatureInfo, - CRS + CRS, + Legends, + Catalog, + GeoportalZoom, + GeoportalOverviewMap, + GeoportalFullScreen } from "geoportal-extensions-openlayers"; import Gp from "geoportal-access-lib" @@ -62,6 +67,11 @@ import JsonGeoportalMousePosition from "./data/openlayers-mouseposition.doclet.j import JsonReverseGeocode from "./data/openlayers-reversegeocode.doclet.json"; import JsonRoute from "./data/openlayers-route.doclet.json"; import JsonSearchEngine from "./data/openlayers-searchengine.doclet.json"; +import JsonFullScreen from "./data/openlayers-geoportalfullscreen.doclet.json"; +import JsonOverviewMap from "./data/openlayers-geoportaloverviewmap.doclet.json"; +import JsonZoom from "./data/openlayers-geoportalzoom.doclet.json"; +import JsonCatalog from "./data/openlayers-catalog.doclet.json"; +import JsonLegends from "./data/openlayers-legends.doclet.json"; import JsonOlView from "./data/ol/openlayers-view.json"; import JsonOlLayer from "./data/ol/openlayers-layer.json"; @@ -162,7 +172,7 @@ export function addMap(options, status) { var opts; if (status.drawing) { opts = setOptions(options.drawing); - var drawing = new Drawing(); + var drawing = new Drawing(opts); map.addControl(drawing); tpl.addWidget("drawing", opts); } @@ -244,6 +254,40 @@ export function addMap(options, status) { map.addControl(attributions); tpl.addWidget("geoportalattribution", opts); } + if (status.geoportalzoom) { + opts = setOptions(options.geoportalzoom); + var zoom = new GeoportalZoom(opts); + map.addControl(zoom); + tpl.addWidget("geoportalzoom", opts); + } + if (status.geoportalfullscreen) { + opts = setOptions(options.geoportalfullscreen); + opts.position = "bottom-left"; + var fullscreen = new GeoportalFullScreen(opts); + map.addControl(fullscreen); + tpl.addWidget("geoportalfullscreen", opts); + } + if (status.legends) { + opts = setOptions(options.legends); + opts.position = "bottom-left"; + var legends = new Legends(opts); + map.addControl(legends); + tpl.addWidget("legends", opts); + } + if (status.catalog) { + opts = setOptions(options.catalog); + opts.position = "bottom-left"; + var catalog = new Catalog(opts); + map.addControl(catalog); + tpl.addWidget("catalog", opts); + } + if (status.geoportaloverviewmap) { + opts = setOptions(options.geoportaloverviewmap); + opts.position = "bottom-left"; + var overviewmap = new GeoportalOverviewMap(opts); + map.addControl(overviewmap); + tpl.addWidget("geoportaloverviewmap", opts); + } }; // Appel autoconf @@ -278,7 +322,12 @@ export function getWidgetOptions() { reversegeocode : JsonReverseGeocode, searchengine : JsonSearchEngine, isocurve : JsonIsoCurve, - elevationpath : JsonElevationPath + elevationpath : JsonElevationPath, + geoportalfullscreen : JsonFullScreen, + geoportalzoom : JsonZoom, + geoportaloverviewmap : JsonOverviewMap, + catalog : JsonCatalog, + legends : JsonLegends, }; } @@ -308,7 +357,12 @@ export function getWidgetStatus() { reversegeocode : false, searchengine : false, isocurve : false, - elevationpath : false + elevationpath : false, + geoportalfullscreen : true, + geoportalzoom : true, + geoportaloverviewmap : true, + catalog : true, + legends : true }; } diff --git a/src/template.js b/src/template.js index 4b45497..cc5e080 100644 --- a/src/template.js +++ b/src/template.js @@ -71,6 +71,26 @@ var data = { geoportalattribution: { code: "", class: "GeoportalAttribution" + }, + geoportalzoom: { + code: "", + class: "GeoportalZoom" + }, + geoportaloverviewmap: { + code: "", + class: "GeoportalOverviewMap" + }, + geoportalfullscreen: { + code: "", + class: "GeoportalFullScreen" + }, + catalog: { + code: "", + class: "Catalog" + }, + legends: { + code: "", + class: "Legends" } } }; diff --git a/vue.config.js b/vue.config.js index 2b4e93d..f0fd707 100644 --- a/vue.config.js +++ b/vue.config.js @@ -9,7 +9,7 @@ module.exports = { plugins: [ new CopyWebpackPlugin ({ patterns : [ - { from : path.join(__dirname, "node_modules/geoportal-extensions-openlayers/css/Portail.css"), to : "theme"}, + { from : path.join(__dirname, "node_modules/geoportal-extensions-openlayers/css/Classic.css"), to : "theme"}, { from : path.join(__dirname, "node_modules/geoportal-extensions-openlayers/css/Dsfr.css"), to : "theme"}, { from : path.join(__dirname, "node_modules/@gouvfr/dsfr/dist/dsfr.css"), to : "dsfr"}, { from : path.join(__dirname, "node_modules/@gouvfr/dsfr/dist/utility/icons/icons-system/icons-system.css"), to : "dsfr/utility/icons/icons-system/"}, @@ -21,7 +21,7 @@ module.exports = { append : false, links : [ { - path : "theme/Portail.css", + path : "theme/Classic.css", attributes : { rel : "stylesheet", id : "portail"