Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type and adds to the Menu as a checkbox item.
-
Kind: global function
+
Kind: global function
@@ -2309,11 +2304,6 @@
fetchDataAndMenu(
Import all features as unique or group based on a field ('all', 'field').
-
position
-
string
-
Position of the layer: 'top', below 'labels' or below 'lines'.
-
-
options
Object
Additional options for configuring the layer.
@@ -2323,7 +2313,7 @@
fetchDataAndMenu(
on(type, func)
Adds an event listener to the map.
-
Kind: global function
+
Kind: global function
@@ -2348,7 +2338,7 @@
on(type, func)
getSource(source)
Retrieves the specified source from the map.
-
Kind: global function
+
Kind: global function
@@ -2368,7 +2358,7 @@
getSource(source)
addSource(source, options)
Adds a source to the map.
-
Kind: global function
+
Kind: global function
@@ -2393,7 +2383,7 @@
addSource(source, options)
setStyle(style, [options])
Sets the style of the map.
-
Kind: global function
+
Kind: global function
@@ -2418,7 +2408,7 @@
setStyle(style, [options])
getLayer(layerId)
Retrieves the layer with the specified ID from the map.
-
Kind: global function
+
Kind: global function
@@ -2438,7 +2428,7 @@
getLayer(layerId)
setFilter(layerId, filter, options)
Set filter for specified style layer.
-
Kind: global function
+
Kind: global function
@@ -2468,7 +2458,7 @@
setFilter(layerId, filter, options)
jumpTo(options)
Jumps to the specified coordinates and zoom on the map.
-
Kind: global function
+
Kind: global function
@@ -2488,7 +2478,7 @@
jumpTo(options)
setLayoutProperty(object, property, value)
Sets layout property for a layer on the map.
-
Kind: global function
+
Kind: global function
@@ -2518,7 +2508,7 @@
setLayoutProperty(object, proper
setPaintProperty(object, property, value)
Sets layout property for a layer on the map.
-
Kind: global function
+
Kind: global function
@@ -2548,7 +2538,7 @@
setPaintProperty(object, property
addControl(control, [position])
Adds a control to the map with the specified position.
-
Kind: global function
+
Kind: global function
@@ -2574,14 +2564,14 @@
addControl(control, [position])
-
getZoom() →number
+
getZoom() → number
Retrieves the current zoom level of the map.
Kind: global function Returns: number - - The current zoom level.
addMouseCoordControl([position])
Adds a mouse coordinate control to the map.
-
Kind: global function
+
Kind: global function
@@ -2621,7 +2611,7 @@
addMouseCoordControl([position])
addGeolocateControl(options, [position])
Adds a geolocate control to the map.
-
Kind: global function
+
Kind: global function
@@ -2649,7 +2639,7 @@
addGeolocateControl(options, [posit
addFullscreenControl(options, [position])
Adds a fullscreen control to the map.
-
Kind: global function
+
Kind: global function
@@ -2679,15 +2669,15 @@
getBounds()
Retrieves the bounds of the map.
Kind: global function
-
getCenter() →LngLat
+
getCenter() → LngLat
Retrieves the center coordinates of the map.
Kind: global function Returns: LngLat - - The center coordinates of the map.
-
setTerrain(options) →Object
+
setTerrain(options) → Object
Sets terrain options for the map.
Kind: global function
-Returns: Object - - Result of setting the terrain options.
+Returns: Object - - Result of setting the terrain options.
@@ -2707,7 +2697,7 @@
setTerrain(options) →Object
setLayerZoomRange(layerId, minZoom, maxZoom)
Sets the zoom range for a specific layer on the map.
-
Kind: global function
+
Kind: global function
@@ -2741,7 +2731,7 @@
getCanvas()
setCenter(coordinates)
Sets the center of the map to the provided coordinates.
-
Kind: global function
+
Kind: global function
@@ -2761,7 +2751,7 @@
setCenter(coordinates)
addLayer(layer, layerIdOrder)
Adds a layer to the map.
-
Kind: global function
+
Kind: global function
@@ -2786,7 +2776,7 @@
addLayer(layer, layerIdOrder)
addLayerGeoJSON(layer, position)
Adds a GeoJSON layer to the map.
-
Kind: global function
+
Kind: global function
@@ -2839,9 +2829,9 @@
addLayerGeoJSON(layer, position)
-
addLayerWMS(layer, position)
+
addLayerWMS(layer, position, exportOptions)
Adds a WMS layer to the map.
-
Kind: global function
+
Kind: global function
@@ -2876,12 +2866,17 @@
addLayerWMS(layer, position)
string
Position of the layer: 'top', below 'labels' or below 'lines'.
+
+
exportOptions
+
Object
+
Options of the layer: type, layout, paint.
+
removeControl(control)
Removes a control from the map.
-
Kind: global function
+
Kind: global function
@@ -2901,7 +2896,7 @@
removeControl(control)
removeLayer(layerId)
Removes a layer from the map.
-
Kind: global function
+
Kind: global function
@@ -2921,7 +2916,7 @@
removeLayer(layerId)
removeSource(layerId)
Removes a source from the map.
-
Kind: global function
+
Kind: global function
@@ -2941,7 +2936,7 @@
removeSource(layerId)
addLogo(options, position)
Adds a logo to the map.
-
Kind: global function
+
Kind: global function
@@ -2986,7 +2981,7 @@
addLogo(options, position)
addBasemapsICGC(basesArray)
Adds base layers to the map.
-
Kind: global function
+
Kind: global function
@@ -3006,7 +3001,7 @@
addBasemapsICGC(basesArray)
addBasemaps(baseLayers)
Adds base layers to the map.
-
Kind: global function
+
Kind: global function
@@ -3041,7 +3036,7 @@
addBasemaps(baseLayers)
addFeatureQuery(layerName, options, popupStyle)
Adds feature query function to a layer.
-
Kind: global function
+
Kind: global function
@@ -3070,9 +3065,11 @@
addFeatureQuery(layerName,
addScaleControl(options, position)
-
Adds a scale control to the map.
- * @function addScaleControl
-
Kind: global function
+
Adds a scale control to the map.
+
+
@function addScaleControl
+
+
Kind: global function
@@ -3097,7 +3094,7 @@
addScaleControl(options, position)
addExportControl(options, [position])
Adds an export control to the map with the provided options and position.
-
Kind: global function
+
Kind: global function
@@ -3122,7 +3119,7 @@
addExportControl(options, [position])<
addPopup(coordinates, text)
Adds a popup to the map.
-
Kind: global function
+
Kind: global function
@@ -3145,10 +3142,10 @@
addPopup(coordinates, text)
-
addMarker(options) →Object
+
addMarker(options) → Object
Adds a marker to the map.
Kind: global function
-Returns: Object - - Instance of the added marker.
+Returns: Object - - Instance of the added marker.
La biblioteca MapICGC GL JS, creada com a envoltori de MapLibreGL, ofereix noves funcions espec\u00edfiques en un entorn ICGC. Simplifica el desenvolupament integrant caracter\u00edstiques com tessel\u00b7les vectorials i imatges satel\u00b7litals, i incorpora de manera inmediata estils, terrenys i dades ICGC. Proporciona funcions documentades per a la creaci\u00f3 d'un visor complet i totalment personalitzable.
La llibreria MapICGC GL JS, basada en Maplibre GL, \u00e9s una eina desenvolupada per l'Institut Cartogr\u00e0fic i Geol\u00f2gic de Catalunya (ICGC) per millorar la cartografia web i proporcionar una soluci\u00f3 integrada als desenvolupadors. Permet accedir f\u00e0cilment a dades geoespacials de l'ICGC, com ara tessel\u00b7les vectorials, imatges satel\u00b7litals i models d'elevaci\u00f3 del terreny, facilitant la creaci\u00f3 de visors web personalitzats. A m\u00e9s, ofereix funcions per a la gesti\u00f3 de dades en temps d'execuci\u00f3, com geocodificaci\u00f3 i geolocalitzaci\u00f3, i el seu disseny modular permet la seva aplicaci\u00f3 en una \u00e0mplia gamma de projectes de cartografia i gesti\u00f3 de recursos.
La biblioteca MapICGC GL JS funciona integrant funcionalitats de Maplibre GL i proporcionant acc\u00e9s a dades geoespacials de l'Institut Cartogr\u00e0fic i Geol\u00f2gic de Catalunya (ICGC). Per integrar-ho al teu projecte, nom\u00e8s cal instal\u00b7lar la llibreria mitjan\u00e7ant npm o integrar-la a trav\u00e9s de CDN.
"},{"location":"#autor-i-contacte","title":"Autor i contacte","text":"
Unitat Geostart, Institut Cartogr\u00e0fic i Geol\u00f2gic de Catalunya.
"},{"location":"1.1.Inst_npm/","title":"1.1 Instal\u00b7laci\u00f3 via NPM","text":""},{"location":"1.1.Inst_npm/#installacio-amb-npm","title":"Instal\u00b7laci\u00f3 amb NPM","text":"
Si utilitzes npm (Node Package Manager) per gestionar les depend\u00e8ncies del teu projecte, segueix aquests passos:
1.Obre la teva terminal i navega fins al directori del teu projecte.
2.Executa la seg\u00fcent comanda per instal\u00b7lar mapicgc-gl-js:
npm install mapicgc-gl-js\n
Aix\u00f2 descarregar\u00e0 i instal\u00b7lar\u00e0 la llibreria al teu projecte.
3.Un cop completada la instal\u00b7laci\u00f3, pots importar la llibreria al teu codi:
Ara est\u00e0s llest per comen\u00e7ar a utilitzar mapicgc-gl-js, seguint l'exemple seg\u00fcent:
<script>\n import { Map, Styles } from \"mapicgc-gl-js\";\n //import * as mapicgc from \"mapicgc-gl-js\" ****;\n const map = new Map({\n container: \"map\",\n style: Styles.LIGHT, // or mapicgc.Styles.LIGHT ****\n hash: true,\n center: [2.1282, 41.45],\n pitch: 0,\n maxZoom: 20,\n zoom: 8,\n\n bearing: 0,\n });\n</script>\n
"},{"location":"1.2.Inst_cdn/","title":"1.2 Instal\u00b7laci\u00f3 via CDN","text":""},{"location":"1.2.Inst_cdn/#installacio-amb-cdn","title":"Instal\u00b7laci\u00f3 amb CDN","text":"
Si prefereixes utilitzar un CDN per incorporar la llibreria al teu projecte, pots seguir aquests passos:
1.Obre la teva terminal i navega fins al directori del teu projecte.
2.Afegir la l\u00ednia seg\u00fcent al teu fitxer HTML, generalment col\u00b7locada dins la secci\u00f3 <head>:
Aix\u00f2 carregar\u00e0 la llibreria directament des del CDN. Ara est\u00e0s llest per utilitzar mapicgc-gl-js al teu projecte seguint l'exemple seg\u00fcent:
"},{"location":"2.11.FetchData/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.11.FetchData/#capes-fgb-icgc","title":"Capes FGB ICGC","text":""},{"location":"2.11.FetchData/#layersfgbadminid","title":"Layers.FGBAdmin.{id}","text":"id agrupacionsCensalsVigent agrupacionsCensalsVigentText areesBasiquesPolicialsVigent areesBasiquesPolicialsVigentText areesBasiquesServeisSocialsVigent areesBasiquesServeisSocialsVigentText areesGestioAssistencialVigent areesHidrogeologiquesAquifersVigent catalunyaVigent catalunyaVigentText comarquesVigent comarquesVigentText districtesCensalsVigent districtesCensalsVigentText incendisForestalsVigent incendisForestalsVigentText municipisVigent municipisVigentText partitsJudicialsVigent partitsJudicialsVigentText plaTerritorialVigent plaTerritorialVigentText provinciesVigent provinciesVigentText regionsPolicialsVigent regionsPolicialsVigentText regionsSanitariesVigent regionsSanitariesVigentText seccionsCensalsVigent seccionsCensalsVigentText sectorsSanitarisVigent vegueriesVigent vegueriesVigentText"},{"location":"2.12.FetchDataAndMenu/","title":"2.14 Fetch dades i crea men\u00fa","text":""},{"location":"2.12.FetchDataAndMenu/#exemple","title":"Exemple","text":"
<html>\n <head>\n <meta charset=\"utf-8\" />\n <title>Exemple mapicgc-gl-js: Fetch dades</title>\n <meta\n name=\"viewport\"\n content=\"initial-scale=1,maximum-scale=1,user-scalable=no\"\n />\n <script src=\"https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.js\"></script>\n <link\n href=\"https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.css\"\n rel=\"stylesheet\"\n />\n\n <style>\n body {\n margin: 0;\n padding: 0;\n }\n #map {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n }\n </style>\n </head>\n <body>\n <div id=\"map\"></div>\n <nav id=\"menu-group\" class=\"filter-group\"></nav>\n\n <script>\n const map = new mapicgcgl.Map({\n container: \"map\",\n style: mapicgcgl.Styles.LIGHT,\n center: [1.808, 41.618],\n zoom: 10,\n maxZoom: 19,\n hash: true,\n pitch: 0,\n });\n\n let layerPosition = \"top\"; // select: 'top', 'lines' or 'labels'\n let filterField = \"municipi\"; // select 'all' for view all the features as a single layer\n let paintOptions = {\n \"line-color\": \"green\",\n \"line-width\": 3,\n \"line-opacity\": 1,\n };\n let filterFGBField = \"NOMPROV\"; // select 'all' for view all the features as a single layer\n let paintOptionsfgb = {\n \"fill-color\": \"blue\",\n \"fill-opacity\": 0.6,\n };\n\n map.on(\"load\", () => {\n\n map.addFullscreenControl();\n\n //geojson\n map.fetchDataAndMenu(\n \"https://analisi.transparenciacatalunya.cat/resource/pzaa-n72w.geojson\",\n \"RutesMontserrat\",\n filterField,\n layerPosition,\n paintOptions\n );\n\n //ICGC FGB data:\n map.fetchDataAndMenu(\n mapicgcgl.Layers.FGBAdmin.provinciesVigent,\n \"Provincies\", filterFGBField, layerPosition, paintOptionsfgb);\n\n //external FGB data:\n map.fetchDataAndMenu(\n \"https://flatgeobuf.org/test/data/UScounties.fgb\",\n \"UScounties\", 'all', layerPosition, paintOptionsfgb);\n\n });\n </script>\n </body>\n</html>\n
"},{"location":"2.12.FetchDataAndMenu/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.12.FetchDataAndMenu/#capes-fgb-icgc","title":"Capes FGB ICGC","text":""},{"location":"2.12.FetchDataAndMenu/#layersfgbadminid","title":"Layers.FGBAdmin.{id}","text":"id agrupacionsCensalsVigent agrupacionsCensalsVigentText areesBasiquesPolicialsVigent areesBasiquesPolicialsVigentText areesBasiquesServeisSocialsVigent areesBasiquesServeisSocialsVigentText areesGestioAssistencialVigent areesHidrogeologiquesAquifersVigent catalunyaVigent catalunyaVigentText comarquesVigent comarquesVigentText districtesCensalsVigent districtesCensalsVigentText incendisForestalsVigent incendisForestalsVigentText municipisVigent municipisVigentText partitsJudicialsVigent partitsJudicialsVigentText plaTerritorialVigent plaTerritorialVigentText provinciesVigent provinciesVigentText regionsPolicialsVigent regionsPolicialsVigentText regionsSanitariesVigent regionsSanitariesVigentText seccionsCensalsVigent seccionsCensalsVigentText sectorsSanitarisVigent vegueriesVigent vegueriesVigentText"},{"location":"2.13.AddFeatureQuery/","title":"2.15 Consulta d'elements","text":""},{"location":"2.13.AddFeatureQuery/#exemple","title":"Exemple","text":"
.addFeatureQuery(layer, queryFields, popupStyle)
Retorna informaci\u00f3 al fer clic sobre un element
See the Pen Exemple Consulta d'elements by unitatgeostart (@unitatgeostart) on CodePen.
"},{"location":"2.3.AddImageLayerICGC/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.3.AddImageLayerICGC/#capes-dimatge-icgc","title":"Capes d'imatge ICGC","text":""},{"location":"2.3.AddImageLayerICGC/#layersortoid","title":"Layers.Orto.{id}","text":"id ortofotoColorProvisional ortofotoColor2022 ortofotoColor2021 ortofotoColor2020 ortofotoColor2019 ortofotoColor2018 ortofotoColor2017 ortofotoColor2016 ortofotoColor2015 ortofotoColor2014 ortofotoColor2013 ortofotoColor2012 ortofotoColor2011 ortofotoColor2010 ortofotoColor2009 ortofotoColor2008 ortofotoColor20062007 ortofotoColor20042005 ortofotoColor20002003 ortofotoBlancINegre1998 ortofotoBlancINegre19941997 ortofotoColor1993 ortofotoBlancINegre19831992 ortofotoBlancINegre19701977 ortofotoBlancINegre1956 ortofotoBlancINegre1945 ortofotoColorSerieAnual ortofotoInfraroigProvisional ortofotoInfraroig2022 ortofotoInfraroig2021 ortofotoInfraroig2020 ortofotoInfraroig2019 ortofotoInfraroig2018 ortofotoInfraroig2017 ortofotoInfraroig2016 ortofotoInfraroig2015 ortofotoInfraroig2014 ortofotoInfraroig2013 ortofotoInfraroig2012 ortofotoInfraroig2011 ortofotoInfraroig2010 ortofotoInfraroig2009 ortofotoInfraroig2008 ortofotoInfraroig20062007 ortofotoInfraroig19961997 ortofotoInfraroigSerieAnual"},{"location":"2.3.AddImageLayerICGC/#layerswmsid","title":"Layers.WMS.{id}","text":"id espaisInteresGeologic gravimetriaBouguer500000 cobertesSol2018 administratiu simplificat cims"},{"location":"2.4.AddVectorLayerFGBICGC/","title":"2.4.AddVectorLayerFGBICGC","text":""},{"location":"2.4.AddVectorLayerFGBICGC/#exemple","title":"Exemple","text":"
"},{"location":"2.4.AddVectorLayerICGC/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.4.AddVectorLayerICGC/#capes-vector-icgc","title":"Capes vector ICGC","text":""},{"location":"2.4.AddVectorLayerICGC/#layersvectoradminid","title":"Layers.VectorAdmin.{id}","text":"id agrupacionsCensals2015 agrupacionsCensals2016 agrupacionsCensals2017 agrupacionsCensals2018 agrupacionsCensals2019 agrupacionsCensals2020 agrupacionsCensals2021 agrupacionsCensalsVigent agrupacionsCensalsVigentText areesBasiquesPolicials2019 areesBasiquesPolicials2020 areesBasiquesPolicials2022 areesBasiquesPolicialsVigent areesBasiquesPolicialsVigentText areesBasiquesSalutVigent areesBasiquesServeisSocialsVigent areesBasiquesServeisSocialsVigentText areesGestioAssistencialVigent areesHidrogeologiquesAquifersVigent catalunyaVigent catalunyaVigentText comarques2022 comarquesVigent comarquesVigentText districtesCensals2015 districtesCensals2016 districtesCensals2017 districtesCensals2018 districtesCensals2019 districtesCensals2020 districtesCensals2021 districtesCensals2022 districtesCensalsVigent districtesCensalsVigentText incendisForestalsVigent incendisForestalsVigentText municipis2022 municipis2022Text municipisVigent municipisVigentText partitsJudicialsVigent partitsJudicialsVigentText plaTerritorial2015 plaTerritorialVigent plaTerritorialVigentText provinciesVigent provinciesVigentText regionsPolicialsVigent regionsPolicialsVigentText regionsSanitariesVigent regionsSanitariesVigentText seccionsCensals2015 seccionsCensals2016 seccionsCensals2017 seccionsCensals2018 seccionsCensals2019 seccionsCensals2020 seccionsCensals2021 seccionsCensals2022 seccionsCensalsVigent seccionsCensalsVigentText sectorsSanitarisVigent vegueriesVigent vegueriesVigentText"},{"location":"2.4.AddVectorLayerICGC/#layersvectorid","title":"Layers.Vector.{id}","text":"id cobertes2018"},{"location":"2.5.AddLayerGeojson/","title":"2.7 Afegir capa GeoJSON","text":""},{"location":"2.5.AddLayerGeojson/#exemple","title":"Exemple","text":"
.addLayerGeoJSON(geojsonLayer, layerPosition)
See the Pen Exemple AddMarker by unitatgeostart (@unitatgeostart) on CodePen.
"},{"location":"2.5.AddLayerGeojson/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.6.AddLayerTree/","title":"2.8 Afegir llistat de capes","text":""},{"location":"2.6.AddLayerTree/#exemple","title":"Exemple","text":"
.addLayerTree(options)
See the Pen Exemple AddMarker by unitatgeostart (@unitatgeostart) on CodePen.
Kind: global function Returns: image - - The image.
Param Type Description urlImage string The url image png or jpep. "},{"location":"3.1.Funcions_doc/#addimageimagename-imagedata-image","title":"addImage(imageName, imageData) \u2192image","text":"
Add image to mapstyle.
Kind: global function Returns: image - - The image.
Param Type Description imageName string The url image png or jpep. imageData image The image.data from return of loadImage function. "},{"location":"3.1.Funcions_doc/#getconfigstyles-array","title":"getConfigStyles() \u2192Array","text":"
Retrieves the available base styles from default options.
Kind: global function Returns: Array - - Array containing the names of available base styles.
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type.
Kind: global function
Param Type Description url string The URL to fetch GeoJSON data from. name string The geometry name (e.g., 'buildings'). position string Position of the layer: 'top', below 'labels' or below 'lines'. options Object Additional options for configuring the layer. "},{"location":"3.1.Funcions_doc/#fetchdataandmenuurl-name-featuretree-position-options","title":"fetchDataAndMenu(url, name, featureTree, position, options)","text":"
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type and adds to the Menu as a checkbox item.
Kind: global function
Param Type Description url string The URL to fetch GeoJSON data from. name string The geometry name (e.g., 'buildings'). featureTree string Import all features as unique or group based on a field ('all', 'field'). position string Position of the layer: 'top', below 'labels' or below 'lines'. options Object Additional options for configuring the layer. "},{"location":"3.1.Funcions_doc/#ontype-func","title":"on(type, func)","text":"
Adds an event listener to the map.
Kind: global function
Param Type Description type string The type of the event. func function The callback function to be executed when the event occurs. "},{"location":"3.1.Funcions_doc/#getsourcesource","title":"getSource(source)","text":"
Retrieves the specified source from the map.
Kind: global function
Param Type Description source string The ID of the source to retrieve. "},{"location":"3.1.Funcions_doc/#addsourcesource-options","title":"addSource(source, options)","text":"
Adds a source to the map.
Kind: global function
Param Type Description source string The ID of the source to add. options object The source options. "},{"location":"3.1.Funcions_doc/#setstylestyle-options","title":"setStyle(style, [options])","text":"
Sets the style of the map.
Kind: global function
Param Type Description style string Name of the map style. [options] Object Options for setting the style. "},{"location":"3.1.Funcions_doc/#getlayerlayerid","title":"getLayer(layerId)","text":"
Retrieves the layer with the specified ID from the map.
Kind: global function
Param Type Description layerId string The ID of the layer to retrieve. "},{"location":"3.1.Funcions_doc/#setfilterlayerid-filter-options","title":"setFilter(layerId, filter, options)","text":"
Set filter for specified style layer.
Kind: global function
Param Type Description layerId string The ID of the layer to retrieve. filter array The filter. options string Options object. "},{"location":"3.1.Funcions_doc/#jumptooptions","title":"jumpTo(options)","text":"
Jumps to the specified coordinates and zoom on the map.
Kind: global function
Param Type Description options Object Coordinates and options to jump to: { center: [coordx, coordy], zoom: zoom, essential: true }. "},{"location":"3.1.Funcions_doc/#setlayoutpropertyobject-property-value","title":"setLayoutProperty(object, property, value)","text":"
Sets layout property for a layer on the map.
Kind: global function
Param Type Description object Object Object containing layer ID. property Object Object containing property to set. value Object Object containing value. "},{"location":"3.1.Funcions_doc/#setpaintpropertyobject-property-value","title":"setPaintProperty(object, property, value)","text":"
Sets layout property for a layer on the map.
Kind: global function
Param Type Description object Object Object containing layer ID. property Object Object containing property to set. value Object Object containing value. "},{"location":"3.1.Funcions_doc/#addcontrolcontrol-position","title":"addControl(control, [position])","text":"
Adds a control to the map with the specified position.
Kind: global function
Param Type Default Description control Object The control to add. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#getzoom-number","title":"getZoom() \u2192number","text":"
Retrieves the current zoom level of the map.
Kind: global function Returns: number - - The current zoom level.
Param Type Default Description options.width Number Width control i. options.utm Boolean Boolean to show coordinates in UTM. options.lonlat Boolean Boolean to show coordinates in Lon Lat. [position] string\"'bottom-left'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addgeolocatecontroloptions-position","title":"addGeolocateControl(options, [position])","text":"
Adds a geolocate control to the map.
Kind: global function
Param Type Default Description options Object Options for the geolocate control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addfullscreencontroloptions-position","title":"addFullscreenControl(options, [position])","text":"
Adds a fullscreen control to the map.
Kind: global function
Param Type Default Description options Object Options for the geolocate control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#getbounds","title":"getBounds()","text":"
Kind: global function Returns: Object - - Result of setting the terrain options.
Param Type Description options Object Options for the terrain. "},{"location":"3.1.Funcions_doc/#setlayerzoomrangelayerid-minzoom-maxzoom","title":"setLayerZoomRange(layerId, minZoom, maxZoom)","text":"
Sets the zoom range for a specific layer on the map.
Kind: global function
Param Type Description layerId string The ID of the layer to set the zoom range for. minZoom number The minimum zoom level. maxZoom number The maximum zoom level. "},{"location":"3.1.Funcions_doc/#getcanvas","title":"getCanvas()","text":"
Sets the center of the map to the provided coordinates.
Kind: global function
Param Type Description coordinates Array Coordinates to center the map: [1.3119, 41.489] "},{"location":"3.1.Funcions_doc/#addlayerlayer-layeridorder","title":"addLayer(layer, layerIdOrder)","text":"
Adds a layer to the map.
Kind: global function
Param Type Description layer Object Options for the layer to add. layerIdOrder string Optional layer Id draw position. "},{"location":"3.1.Funcions_doc/#addlayergeojsonlayer-position","title":"addLayerGeoJSON(layer, position)","text":"
Adds a GeoJSON layer to the map.
Kind: global function
Param Type Description layer Object Options for the GeoJSON layer to add. layer.id string Unique identifier for the layer. layer.type string Type of layer ('geojson'). layer.data Object GeoJSON data for the layer. layer.layerType string Map layer type (e.g., 'symbol', 'circle', 'fill'). layer.layout Object Layer layout configuration. layer.paint Object Layer paint configuration. position string Position of the layer: 'top', below 'labels' or below 'lines'. "},{"location":"3.1.Funcions_doc/#addlayerwmslayer-position","title":"addLayerWMS(layer, position)","text":"
Adds a WMS layer to the map.
Kind: global function
Param Type Description layer Object Options for the WMS layer to add. layer.id string Unique identifier for the layer. layer.type string Type of layer ('raster'). layer.tiles Array.<string> Tiles for the raster layer. position string Position of the layer: 'top', below 'labels' or below 'lines'. "},{"location":"3.1.Funcions_doc/#removecontrolcontrol","title":"removeControl(control)","text":"
Removes a control from the map.
Kind: global function
Param Type Description control Object The control to remove. "},{"location":"3.1.Funcions_doc/#removelayerlayerid","title":"removeLayer(layerId)","text":"
Removes a layer from the map.
Kind: global function
Param Type Description layerId string Identifier of the layer to remove. "},{"location":"3.1.Funcions_doc/#removesourcelayerid","title":"removeSource(layerId)","text":"
Removes a source from the map.
Kind: global function
Param Type Description layerId string Identifier of the source to remove. "},{"location":"3.1.Funcions_doc/#addlogooptions-position","title":"addLogo(options, position)","text":"
Adds a logo to the map.
Kind: global function
Param Type Description options Object Options for the logo to add. options.id string Unique identifier for the logo. options.url string URL of the logo image. options.href string URL to navigate to when the logo is clicked. options.height string Height of the logo. position string Position of the logo. "},{"location":"3.1.Funcions_doc/#addbasemapsicgcbasesarray","title":"addBasemapsICGC(basesArray)","text":"
Adds base layers to the map.
Kind: global function
Param Type Description basesArray Array.<Object> Array of base layer objects. "},{"location":"3.1.Funcions_doc/#addbasemapsbaselayers","title":"addBasemaps(baseLayers)","text":"
Adds base layers to the map.
Kind: global function
Param Type Description baseLayers Array.<Object> Array of base layer objects. baseLayers.label string Label for the base layer. baseLayers.image string URL of the image representing the base layer. baseLayers.url string URL of the base layer style. "},{"location":"3.1.Funcions_doc/#addfeaturequerylayername-options-popupstyle","title":"addFeatureQuery(layerName, options, popupStyle)","text":"
Adds feature query function to a layer.
Kind: global function
Param Type Description layerName string name of the layer options objetc optional indications for the popup popupStyle objetc optional indications for the popup style "},{"location":"3.1.Funcions_doc/#addscalecontroloptions-position","title":"addScaleControl(options, position)","text":"
Adds a scale control to the map. * @function addScaleControl
Kind: global function
Param Type Description options Object Options for configuring the scale control. position string The position on the map to place the scale control (e.g., 'top-left', 'bottom-right'). "},{"location":"3.1.Funcions_doc/#addexportcontroloptions-position","title":"addExportControl(options, [position])","text":"
Adds an export control to the map with the provided options and position.
Kind: global function
Param Type Description options Object | string Options for the export control or position if provided as a string. [position] string Position to place the export control (e.g., 'top-right'). "},{"location":"3.1.Funcions_doc/#addpopupcoordinates-text","title":"addPopup(coordinates, text)","text":"
Adds a popup to the map.
Kind: global function
Param Type Description coordinates array Coordinates of the popup . text string Text content for the popup. "},{"location":"3.1.Funcions_doc/#addmarkeroptions-object","title":"addMarker(options) \u2192Object","text":"
Adds a marker to the map.
Kind: global function Returns: Object - - Instance of the added marker.
Param Type Description options Object Options for the marker to add. options.text string Text content for the marker popup. options.options Object Marker options. options.coord LngLatLike Coordinates for placing the marker. options.textOffset Object Text offset for the marker popup. "},{"location":"3.1.Funcions_doc/#addpopupoptions-coord-text-popupstyle-object","title":"addPopup(options, coord, text, popupStyle) \u2192Object","text":"
Adds a popup to the map.
Kind: global function Returns: Object - - Instance of the added popup.
Param Type Description options Object Options for the popup to add. coord LngLatLike Coordinates for placing the popup. text string HTML content for the popup. popupStyle string css content for the popup style. "},{"location":"3.1.Funcions_doc/#addfullscreenposition","title":"addFullScreen([position])","text":"
Adds a fullscreen control to the map.
Kind: global function
Param Type Default Description [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addmenuitemname","title":"addMenuItem(name)","text":"
Adds a menu item with a checkbox for controlling the visibility of a layer on the map.
Kind: global function
Param Type Description name string The name of the layer corresponding to the menu item. "},{"location":"3.1.Funcions_doc/#addlayertreeoptions","title":"addLayerTree(options)","text":"
Adds a layer tree to the map.
Kind: global function
Param Type Description options Object Options for the layer tree to add. options.features Object Features for the layer tree. options.id string Unique identifier for the layer tree. options.type string Type of layer tree ('geojson', 'raster', etc.). "},{"location":"3.1.Funcions_doc/#createnavigationcontroloptions-position-object","title":"createNavigationControl(options, [position]) \u2192Object","text":"
Creates a navigation control with the provided options.
Kind: global function Returns: Object - - Instance of the created navigation control.
Param Type Default Description options Object Options for the navigation control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addnavigationcontroloptions-position","title":"addNavigationControl(options, [position])","text":"
Adds a navigation control to the map with the provided options.
Kind: global function
Param Type Default Description options Object Options for the navigation control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addattributioncontroloptions-position","title":"addAttributionControl(options, [position])","text":"
Adds an attribution control to the map with the provided options.
Kind: global function
Param Type Default Description options Object Options for the attribution control. [position] string\"'bottom-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#_dealstylemapsname-string","title":"_dealStyleMaps(name) \u2192string","text":"
Internal method to handle map styles.
Kind: global function Returns: string - - URL of the map style.
Param Type Description name string Name of the map style. "},{"location":"3.1.Funcions_doc/#addimagelayericgcname","title":"addImageLayerICGC(name)","text":"
Adds an ICGC image layer to the map based on the specified name and year.
Kind: global function
Param Type Description name string The name of the layer. Mandatory. options: 'orto', 'geo', 'slope', 'dem', 'relleu', etc. "},{"location":"3.1.Funcions_doc/#addvectorlayericgcurl-position-visiblelabel-paintoption","title":"addVectorLayerICGC(url, position, visibleLabel, paintOption)","text":"
Adds an ICGC vector layer to the map based on the specified name and year.
Kind: global function
Param Type Description url string The url of the vector layer. position string Position of the layer: 'top', below 'labels' or below 'lines'. visibleLabel string Visibility of the label (\"visible\" / \"none\"). paintOption object Paint option for the layer "},{"location":"3.1.Funcions_doc/#addfgblayericgcurl-visiblelabel-paintoption","title":"addFGBLayerICGC(url, visibleLabel, paintOption)","text":"
Adds an ICGC FGB layer to the map based on the specified name and year.
Kind: global function
Param Type Description url string The url of the FGB layer. visibleLabel string Visibility of the label (\"visible\" / \"none\"). paintOption object Paint option for the layer "},{"location":"3.1.Funcions_doc/#addterrainicgcresolution-positionbutton","title":"addTerrainICGC(resolution, [positionButton])","text":"
Adds 3D terrain to the map using hillshade.
Kind: global function
Param Type Default Description resolution string resolution of the terrain data: 2m or 5m. [positionButton] string\"'top-right'\" Position to add the button on the map. "},{"location":"3.1.Funcions_doc/#addlegendname","title":"addLegend(name)","text":"
Adds 3D terrain to the map using hillshade.
Kind: global function
Param Type Description name string name of the layer legend to add."},{"location":"4.1.Versio/","title":"4.1.Versio","text":""},{"location":"4.1.Versio/#versionat","title":"Versionat","text":"
v. 1.0.0
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"MapICGC-gl-js","text":"
La biblioteca MapICGC GL JS, creada com a envoltori de MapLibreGL, ofereix noves funcions espec\u00edfiques en un entorn ICGC. Simplifica el desenvolupament integrant caracter\u00edstiques com tessel\u00b7les vectorials i imatges satel\u00b7litals, i incorpora de manera inmediata estils, terrenys i dades ICGC. Proporciona funcions documentades per a la creaci\u00f3 d'un visor complet i totalment personalitzable.
La llibreria MapICGC GL JS, basada en Maplibre GL, \u00e9s una eina desenvolupada per l'Institut Cartogr\u00e0fic i Geol\u00f2gic de Catalunya (ICGC) per millorar la cartografia web i proporcionar una soluci\u00f3 integrada als desenvolupadors. Permet accedir f\u00e0cilment a dades geoespacials de l'ICGC, com ara tessel\u00b7les vectorials, imatges satel\u00b7litals i models d'elevaci\u00f3 del terreny, facilitant la creaci\u00f3 de visors web personalitzats. A m\u00e9s, ofereix funcions per a la gesti\u00f3 de dades en temps d'execuci\u00f3, com geocodificaci\u00f3 i geolocalitzaci\u00f3, i el seu disseny modular permet la seva aplicaci\u00f3 en una \u00e0mplia gamma de projectes de cartografia i gesti\u00f3 de recursos.
La biblioteca MapICGC GL JS funciona integrant funcionalitats de Maplibre GL i proporcionant acc\u00e9s a dades geoespacials de l'Institut Cartogr\u00e0fic i Geol\u00f2gic de Catalunya (ICGC). Per integrar-ho al teu projecte, nom\u00e8s cal instal\u00b7lar la llibreria mitjan\u00e7ant npm o integrar-la a trav\u00e9s de CDN.
"},{"location":"#autor-i-contacte","title":"Autor i contacte","text":"
Unitat Geostart, Institut Cartogr\u00e0fic i Geol\u00f2gic de Catalunya.
"},{"location":"1.1.Inst_npm/","title":"1.1 Instal\u00b7laci\u00f3 via NPM","text":""},{"location":"1.1.Inst_npm/#installacio-amb-npm","title":"Instal\u00b7laci\u00f3 amb NPM","text":"
Si utilitzes npm (Node Package Manager) per gestionar les depend\u00e8ncies del teu projecte, segueix aquests passos:
1.Obre la teva terminal i navega fins al directori del teu projecte.
2.Executa la seg\u00fcent comanda per instal\u00b7lar mapicgc-gl-js:
npm install mapicgc-gl-js\n
Aix\u00f2 descarregar\u00e0 i instal\u00b7lar\u00e0 la llibreria al teu projecte.
3.Un cop completada la instal\u00b7laci\u00f3, pots importar la llibreria al teu codi:
Ara est\u00e0s llest per comen\u00e7ar a utilitzar mapicgc-gl-js, seguint l'exemple seg\u00fcent:
<script>\n import { Map, Styles } from \"mapicgc-gl-js\";\n //import * as mapicgc from \"mapicgc-gl-js\" ****;\n const map = new Map({\n container: \"map\",\n style: Styles.LIGHT, // or mapicgc.Styles.LIGHT ****\n hash: true,\n center: [2.1282, 41.45],\n pitch: 0,\n maxZoom: 20,\n zoom: 8,\n\n bearing: 0,\n });\n</script>\n
"},{"location":"1.2.Inst_cdn/","title":"1.2 Instal\u00b7laci\u00f3 via CDN","text":""},{"location":"1.2.Inst_cdn/#installacio-amb-cdn","title":"Instal\u00b7laci\u00f3 amb CDN","text":"
Si prefereixes utilitzar un CDN per incorporar la llibreria al teu projecte, pots seguir aquests passos:
1.Obre la teva terminal i navega fins al directori del teu projecte.
2.Afegir la l\u00ednia seg\u00fcent al teu fitxer HTML, generalment col\u00b7locada dins la secci\u00f3 <head>:
Aix\u00f2 carregar\u00e0 la llibreria directament des del CDN. Ara est\u00e0s llest per utilitzar mapicgc-gl-js al teu projecte seguint l'exemple seg\u00fcent:
"},{"location":"2.11.FetchData/#posicio-layerposition","title":"Posici\u00f3 (layerPosition)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.11.FetchData/#capes-fgb-icgc","title":"Capes FGB ICGC","text":""},{"location":"2.11.FetchData/#layersfgbadminid","title":"Layers.FGBAdmin.{id}","text":"id agrupacionsCensalsVigent agrupacionsCensalsVigentText areesBasiquesPolicialsVigent areesBasiquesPolicialsVigentText areesBasiquesServeisSocialsVigent areesBasiquesServeisSocialsVigentText areesGestioAssistencialVigent areesHidrogeologiquesAquifersVigent catalunyaVigent catalunyaVigentText comarquesVigent comarquesVigentText districtesCensalsVigent districtesCensalsVigentText incendisForestalsVigent incendisForestalsVigentText municipisVigent municipisVigentText partitsJudicialsVigent partitsJudicialsVigentText plaTerritorialVigent plaTerritorialVigentText provinciesVigent provinciesVigentText regionsPolicialsVigent regionsPolicialsVigentText regionsSanitariesVigent regionsSanitariesVigentText seccionsCensalsVigent seccionsCensalsVigentText sectorsSanitarisVigent vegueriesVigent vegueriesVigentText"},{"location":"2.12.FetchDataAndMenu/","title":"2.14 Fetch dades i crea men\u00fa","text":""},{"location":"2.12.FetchDataAndMenu/#exemple","title":"Exemple","text":"
<html>\n <head>\n <meta charset=\"utf-8\" />\n <title>Exemple mapicgc-gl-js: Fetch dades</title>\n <meta\n name=\"viewport\"\n content=\"initial-scale=1,maximum-scale=1,user-scalable=no\"\n />\n <script src=\"https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.js\"></script>\n <link\n href=\"https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.css\"\n rel=\"stylesheet\"\n />\n\n <style>\n body {\n margin: 0;\n padding: 0;\n }\n\n #map {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n }\n\n /* Personalitza el teu men\u00fa: */\n #menu-group {\n position: absolute;\n top: 10px;\n left: 10px;\n color: #000000;\n }\n\n #menu-group input[type=\"checkbox\"] + label {\n background-color: #ffffff !important;\n }\n\n #titleDivMenu {\n background-color: rgb(213 212 212);\n }\n\n #titleDivMenuSub {\n background-color: #e9e9e9;\n }\n </style>\n </head>\n <body>\n <div id=\"map\"></div>\n <nav id=\"menu-group\" class=\"filter-group\"></nav>\n\n <script>\n const map = new mapicgcgl.Map({\n container: \"map\",\n style: mapicgcgl.Styles.LIGHT,\n center: [1.808, 41.618],\n zoom: 10,\n maxZoom: 19,\n hash: true,\n pitch: 0,\n });\n\n\n let filterField = \"municipi\"; // select 'all' for view all the features as a single layer\n let paintOptions = {\n \"line-color\": \"green\",\n \"line-width\": 3,\n \"line-opacity\": 1,\n };\n let optionsLayer = {\n layout: {\n visibility: \"visible\",\n },\n paint: {\n \"line-color\": \"green\",\n \"line-width\": 3,\n \"line-opacity\": 1,\n },\n layerPosition: \"labels\",\n };\n\n let filterFGBField = \"NOMPROV\"; // select 'all' for view all the features as a single layer\n let paintOptionsfgb = {\n \"fill-color\": \"grey\",\n \"fill-opacity\": 0.6,\n };\n\n let optionsLayerfgb = {\n layout: {\n visibility: \"visible\",\n },\n paint: {\n \"fill-color\": \"grey\",\n \"fill-opacity\": 0.16,\n },\n layerPosition: \"labels\",\n };\n\n map.on(\"load\", () => {\n map.addFullscreenControl();\n\n //geojson\n map.fetchDataAndMenu(\n \"https://analisi.transparenciacatalunya.cat/resource/pzaa-n72w.geojson\",\n \"RutesMontserrat\",\n filterField,\n optionsLayer\n );\n\n //ICGC FGB data:\n map.fetchDataAndMenu(\n mapicgcgl.Layers.FGBAdmin.provinciesVigent,\n \"Provincies\",\n filterFGBField,\n optionsLayerfgb\n );\n\n //external FGB data:\n map.fetchDataAndMenu(\n \"https://flatgeobuf.org/test/data/UScounties.fgb\",\n \"UScounties\",\n \"all\",\n layerPosition,\n paintOptionsfgb\n );\n });\n </script>\n </body>\n</html>\n
"},{"location":"2.12.FetchDataAndMenu/#posicio-layerposition","title":"Posici\u00f3 (layerPosition)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.12.FetchDataAndMenu/#capes-fgb-icgc","title":"Capes FGB ICGC","text":""},{"location":"2.12.FetchDataAndMenu/#layersfgbadminid","title":"Layers.FGBAdmin.{id}","text":"id agrupacionsCensalsVigent agrupacionsCensalsVigentText areesBasiquesPolicialsVigent areesBasiquesPolicialsVigentText areesBasiquesServeisSocialsVigent areesBasiquesServeisSocialsVigentText areesGestioAssistencialVigent areesHidrogeologiquesAquifersVigent catalunyaVigent catalunyaVigentText comarquesVigent comarquesVigentText districtesCensalsVigent districtesCensalsVigentText incendisForestalsVigent incendisForestalsVigentText municipisVigent municipisVigentText partitsJudicialsVigent partitsJudicialsVigentText plaTerritorialVigent plaTerritorialVigentText provinciesVigent provinciesVigentText regionsPolicialsVigent regionsPolicialsVigentText regionsSanitariesVigent regionsSanitariesVigentText seccionsCensalsVigent seccionsCensalsVigentText sectorsSanitarisVigent vegueriesVigent vegueriesVigentText"},{"location":"2.13.AddFeatureQuery/","title":"2.15 Consulta d'elements","text":""},{"location":"2.13.AddFeatureQuery/#exemple","title":"Exemple","text":"
.addFeatureQuery(layer, queryFields, popupStyle)
Retorna informaci\u00f3 al fer clic sobre un element
See the Pen Exemple Consulta d'elements by unitatgeostart (@unitatgeostart) on CodePen.
"},{"location":"2.3.AddImageLayerICGC/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.3.AddImageLayerICGC/#capes-dimatge-icgc","title":"Capes d'imatge ICGC","text":""},{"location":"2.3.AddImageLayerICGC/#layersortoid","title":"Layers.Orto.{id}","text":"id ortofotoColorProvisional ortofotoColor2022 ortofotoColor2021 ortofotoColor2020 ortofotoColor2019 ortofotoColor2018 ortofotoColor2017 ortofotoColor2016 ortofotoColor2015 ortofotoColor2014 ortofotoColor2013 ortofotoColor2012 ortofotoColor2011 ortofotoColor2010 ortofotoColor2009 ortofotoColor2008 ortofotoColor20062007 ortofotoColor20042005 ortofotoColor20002003 ortofotoBlancINegre1998 ortofotoBlancINegre19941997 ortofotoColor1993 ortofotoBlancINegre19831992 ortofotoBlancINegre19701977 ortofotoBlancINegre1956 ortofotoBlancINegre1945 ortofotoColorSerieAnual ortofotoInfraroigProvisional ortofotoInfraroig2022 ortofotoInfraroig2021 ortofotoInfraroig2020 ortofotoInfraroig2019 ortofotoInfraroig2018 ortofotoInfraroig2017 ortofotoInfraroig2016 ortofotoInfraroig2015 ortofotoInfraroig2014 ortofotoInfraroig2013 ortofotoInfraroig2012 ortofotoInfraroig2011 ortofotoInfraroig2010 ortofotoInfraroig2009 ortofotoInfraroig2008 ortofotoInfraroig20062007 ortofotoInfraroig19961997 ortofotoInfraroigSerieAnual"},{"location":"2.3.AddImageLayerICGC/#layerswmsid","title":"Layers.WMS.{id}","text":"id espaisInteresGeologic gravimetriaBouguer500000 cobertesSol2018 administratiu simplificat cims"},{"location":"2.4.AddVectorLayerFGBICGC/","title":"2.4.AddVectorLayerFGBICGC","text":""},{"location":"2.4.AddVectorLayerFGBICGC/#exemple","title":"Exemple","text":"
"},{"location":"2.4.AddVectorLayerICGC/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.4.AddVectorLayerICGC/#capes-vector-icgc","title":"Capes vector ICGC","text":""},{"location":"2.4.AddVectorLayerICGC/#layersvectoradminid","title":"Layers.VectorAdmin.{id}","text":"id agrupacionsCensals2015 agrupacionsCensals2016 agrupacionsCensals2017 agrupacionsCensals2018 agrupacionsCensals2019 agrupacionsCensals2020 agrupacionsCensals2021 agrupacionsCensalsVigent agrupacionsCensalsVigentText areesBasiquesPolicials2019 areesBasiquesPolicials2020 areesBasiquesPolicials2022 areesBasiquesPolicialsVigent areesBasiquesPolicialsVigentText areesBasiquesSalutVigent areesBasiquesServeisSocialsVigent areesBasiquesServeisSocialsVigentText areesGestioAssistencialVigent areesHidrogeologiquesAquifersVigent catalunyaVigent catalunyaVigentText comarques2022 comarquesVigent comarquesVigentText districtesCensals2015 districtesCensals2016 districtesCensals2017 districtesCensals2018 districtesCensals2019 districtesCensals2020 districtesCensals2021 districtesCensals2022 districtesCensalsVigent districtesCensalsVigentText incendisForestalsVigent incendisForestalsVigentText municipis2022 municipis2022Text municipisVigent municipisVigentText partitsJudicialsVigent partitsJudicialsVigentText plaTerritorial2015 plaTerritorialVigent plaTerritorialVigentText provinciesVigent provinciesVigentText regionsPolicialsVigent regionsPolicialsVigentText regionsSanitariesVigent regionsSanitariesVigentText seccionsCensals2015 seccionsCensals2016 seccionsCensals2017 seccionsCensals2018 seccionsCensals2019 seccionsCensals2020 seccionsCensals2021 seccionsCensals2022 seccionsCensalsVigent seccionsCensalsVigentText sectorsSanitarisVigent vegueriesVigent vegueriesVigentText"},{"location":"2.4.AddVectorLayerICGC/#layersvectorid","title":"Layers.Vector.{id}","text":"id cobertes2018"},{"location":"2.5.AddLayerGeojson/","title":"2.7 Afegir capa GeoJSON","text":""},{"location":"2.5.AddLayerGeojson/#exemple","title":"Exemple","text":"
.addLayerGeoJSON(geojsonLayer, layerPosition)
See the Pen Exemple AddMarker by unitatgeostart (@unitatgeostart) on CodePen.
"},{"location":"2.5.AddLayerGeojson/#posicio-position","title":"Posici\u00f3 (position)","text":"id Descripci\u00f3 'top' Posici\u00f3 de la capa per sobre de tots els elements carregats pr\u00e8viament 'labels' Posici\u00f3 de la capa per sota de tots els elements de tipus etiqueta carregats pr\u00e8viament 'lines' Posici\u00f3 de la capa per sota de tots els elements de tipus l\u00ednia, punt i etiqueta carregats pr\u00e8viament"},{"location":"2.6.AddLayerTree/","title":"2.8 Afegir llistat de capes","text":""},{"location":"2.6.AddLayerTree/#exemple","title":"Exemple","text":"
.addLayerTree(options)
See the Pen Exemple AddMarker by unitatgeostart (@unitatgeostart) on CodePen.
Kind: global function Returns: image - - The image.
Param Type Description urlImage string The url image png or jpep. "},{"location":"3.1.Funcions_doc/#addimageimagename-imagedata-image","title":"addImage(imageName, imageData) \u2192 image","text":"
Add image to mapstyle.
Kind: global function Returns: image - - The image.
Param Type Description imageName string The url image png or jpep. imageData image The image.data from return of loadImage function. "},{"location":"3.1.Funcions_doc/#getconfigstyles-array","title":"getConfigStyles() \u2192 Array","text":"
Retrieves the available base styles from default options.
Kind: global function Returns: Array - - Array containing the names of available base styles.
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type.
Kind: global function
Param Type Description url string The URL to fetch GeoJSON data from. name string The geometry name (e.g., 'buildings'). options Object Additional options for configuring the layer. "},{"location":"3.1.Funcions_doc/#fetchdataandmenuurl-name-featuretree-options","title":"fetchDataAndMenu(url, name, featureTree, options)","text":"
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type and adds to the Menu as a checkbox item.
Kind: global function
Param Type Description url string The URL to fetch GeoJSON data from. name string The geometry name (e.g., 'buildings'). featureTree string Import all features as unique or group based on a field ('all', 'field'). options Object Additional options for configuring the layer. "},{"location":"3.1.Funcions_doc/#ontype-func","title":"on(type, func)","text":"
Adds an event listener to the map.
Kind: global function
Param Type Description type string The type of the event. func function The callback function to be executed when the event occurs. "},{"location":"3.1.Funcions_doc/#getsourcesource","title":"getSource(source)","text":"
Retrieves the specified source from the map.
Kind: global function
Param Type Description source string The ID of the source to retrieve. "},{"location":"3.1.Funcions_doc/#addsourcesource-options","title":"addSource(source, options)","text":"
Adds a source to the map.
Kind: global function
Param Type Description source string The ID of the source to add. options object The source options. "},{"location":"3.1.Funcions_doc/#setstylestyle-options","title":"setStyle(style, [options])","text":"
Sets the style of the map.
Kind: global function
Param Type Description style string Name of the map style. [options] Object Options for setting the style. "},{"location":"3.1.Funcions_doc/#getlayerlayerid","title":"getLayer(layerId)","text":"
Retrieves the layer with the specified ID from the map.
Kind: global function
Param Type Description layerId string The ID of the layer to retrieve. "},{"location":"3.1.Funcions_doc/#setfilterlayerid-filter-options","title":"setFilter(layerId, filter, options)","text":"
Set filter for specified style layer.
Kind: global function
Param Type Description layerId string The ID of the layer to retrieve. filter array The filter. options string Options object. "},{"location":"3.1.Funcions_doc/#jumptooptions","title":"jumpTo(options)","text":"
Jumps to the specified coordinates and zoom on the map.
Kind: global function
Param Type Description options Object Coordinates and options to jump to: { center: [coordx, coordy], zoom: zoom, essential: true }. "},{"location":"3.1.Funcions_doc/#setlayoutpropertyobject-property-value","title":"setLayoutProperty(object, property, value)","text":"
Sets layout property for a layer on the map.
Kind: global function
Param Type Description object Object Object containing layer ID. property Object Object containing property to set. value Object Object containing value. "},{"location":"3.1.Funcions_doc/#setpaintpropertyobject-property-value","title":"setPaintProperty(object, property, value)","text":"
Sets layout property for a layer on the map.
Kind: global function
Param Type Description object Object Object containing layer ID. property Object Object containing property to set. value Object Object containing value. "},{"location":"3.1.Funcions_doc/#addcontrolcontrol-position","title":"addControl(control, [position])","text":"
Adds a control to the map with the specified position.
Kind: global function
Param Type Default Description control Object The control to add. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#getzoom-number","title":"getZoom() \u2192 number","text":"
Retrieves the current zoom level of the map.
Kind: global function Returns: number - - The current zoom level.
Param Type Default Description options.width Number Width control i. options.utm Boolean Boolean to show coordinates in UTM. options.lonlat Boolean Boolean to show coordinates in Lon Lat. [position] string\"'bottom-left'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addgeolocatecontroloptions-position","title":"addGeolocateControl(options, [position])","text":"
Adds a geolocate control to the map.
Kind: global function
Param Type Default Description options Object Options for the geolocate control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addfullscreencontroloptions-position","title":"addFullscreenControl(options, [position])","text":"
Adds a fullscreen control to the map.
Kind: global function
Param Type Default Description options Object Options for the geolocate control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#getbounds","title":"getBounds()","text":"
Kind: global function Returns: Object - - Result of setting the terrain options.
Param Type Description options Object Options for the terrain. "},{"location":"3.1.Funcions_doc/#setlayerzoomrangelayerid-minzoom-maxzoom","title":"setLayerZoomRange(layerId, minZoom, maxZoom)","text":"
Sets the zoom range for a specific layer on the map.
Kind: global function
Param Type Description layerId string The ID of the layer to set the zoom range for. minZoom number The minimum zoom level. maxZoom number The maximum zoom level. "},{"location":"3.1.Funcions_doc/#getcanvas","title":"getCanvas()","text":"
Sets the center of the map to the provided coordinates.
Kind: global function
Param Type Description coordinates Array Coordinates to center the map: [1.3119, 41.489] "},{"location":"3.1.Funcions_doc/#addlayerlayer-layeridorder","title":"addLayer(layer, layerIdOrder)","text":"
Adds a layer to the map.
Kind: global function
Param Type Description layer Object Options for the layer to add. layerIdOrder string Optional layer Id draw position. "},{"location":"3.1.Funcions_doc/#addlayergeojsonlayer-position","title":"addLayerGeoJSON(layer, position)","text":"
Adds a GeoJSON layer to the map.
Kind: global function
Param Type Description layer Object Options for the GeoJSON layer to add. layer.id string Unique identifier for the layer. layer.type string Type of layer ('geojson'). layer.data Object GeoJSON data for the layer. layer.layerType string Map layer type (e.g., 'symbol', 'circle', 'fill'). layer.layout Object Layer layout configuration. layer.paint Object Layer paint configuration. position string Position of the layer: 'top', below 'labels' or below 'lines'. "},{"location":"3.1.Funcions_doc/#addlayerwmslayer-position-exportoptions","title":"addLayerWMS(layer, position, exportOptions)","text":"
Adds a WMS layer to the map.
Kind: global function
Param Type Description layer Object Options for the WMS layer to add. layer.id string Unique identifier for the layer. layer.type string Type of layer ('raster'). layer.tiles Array.<string> Tiles for the raster layer. position string Position of the layer: 'top', below 'labels' or below 'lines'. exportOptions Object Options of the layer: type, layout, paint. "},{"location":"3.1.Funcions_doc/#removecontrolcontrol","title":"removeControl(control)","text":"
Removes a control from the map.
Kind: global function
Param Type Description control Object The control to remove. "},{"location":"3.1.Funcions_doc/#removelayerlayerid","title":"removeLayer(layerId)","text":"
Removes a layer from the map.
Kind: global function
Param Type Description layerId string Identifier of the layer to remove. "},{"location":"3.1.Funcions_doc/#removesourcelayerid","title":"removeSource(layerId)","text":"
Removes a source from the map.
Kind: global function
Param Type Description layerId string Identifier of the source to remove. "},{"location":"3.1.Funcions_doc/#addlogooptions-position","title":"addLogo(options, position)","text":"
Adds a logo to the map.
Kind: global function
Param Type Description options Object Options for the logo to add. options.id string Unique identifier for the logo. options.url string URL of the logo image. options.href string URL to navigate to when the logo is clicked. options.height string Height of the logo. position string Position of the logo. "},{"location":"3.1.Funcions_doc/#addbasemapsicgcbasesarray","title":"addBasemapsICGC(basesArray)","text":"
Adds base layers to the map.
Kind: global function
Param Type Description basesArray Array.<Object> Array of base layer objects. "},{"location":"3.1.Funcions_doc/#addbasemapsbaselayers","title":"addBasemaps(baseLayers)","text":"
Adds base layers to the map.
Kind: global function
Param Type Description baseLayers Array.<Object> Array of base layer objects. baseLayers.label string Label for the base layer. baseLayers.image string URL of the image representing the base layer. baseLayers.url string URL of the base layer style. "},{"location":"3.1.Funcions_doc/#addfeaturequerylayername-options-popupstyle","title":"addFeatureQuery(layerName, options, popupStyle)","text":"
Adds feature query function to a layer.
Kind: global function
Param Type Description layerName string name of the layer options objetc optional indications for the popup popupStyle objetc optional indications for the popup style "},{"location":"3.1.Funcions_doc/#addscalecontroloptions-position","title":"addScaleControl(options, position)","text":"
Adds a scale control to the map.
@function addScaleControl
Kind: global function
Param Type Description options Object Options for configuring the scale control. position string The position on the map to place the scale control (e.g., 'top-left', 'bottom-right'). "},{"location":"3.1.Funcions_doc/#addexportcontroloptions-position","title":"addExportControl(options, [position])","text":"
Adds an export control to the map with the provided options and position.
Kind: global function
Param Type Description options Object | string Options for the export control or position if provided as a string. [position] string Position to place the export control (e.g., 'top-right'). "},{"location":"3.1.Funcions_doc/#addpopupcoordinates-text","title":"addPopup(coordinates, text)","text":"
Adds a popup to the map.
Kind: global function
Param Type Description coordinates array Coordinates of the popup . text string Text content for the popup. "},{"location":"3.1.Funcions_doc/#addmarkeroptions-object","title":"addMarker(options) \u2192 Object","text":"
Adds a marker to the map.
Kind: global function Returns: Object - - Instance of the added marker.
Param Type Description options Object Options for the marker to add. options.text string Text content for the marker popup. options.options Object Marker options. options.coord LngLatLike Coordinates for placing the marker. options.textOffset Object Text offset for the marker popup. "},{"location":"3.1.Funcions_doc/#addpopupoptions-coord-text-popupstyle-object","title":"addPopup(options, coord, text, popupStyle) \u2192 Object","text":"
Adds a popup to the map.
Kind: global function Returns: Object - - Instance of the added popup.
Param Type Description options Object Options for the popup to add. coord LngLatLike Coordinates for placing the popup. text string HTML content for the popup. popupStyle string css content for the popup style. "},{"location":"3.1.Funcions_doc/#addfullscreenposition","title":"addFullScreen([position])","text":"
Adds a fullscreen control to the map.
Kind: global function
Param Type Default Description [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addmenuitemname","title":"addMenuItem(name)","text":"
Adds a menu item with a checkbox for controlling the visibility of a layer on the map.
Kind: global function
Param Type Description name string The name of the layer corresponding to the menu item. "},{"location":"3.1.Funcions_doc/#addlayertreeoptions","title":"addLayerTree(options)","text":"
Adds a layer tree to the map.
Kind: global function
Param Type Description options Object Options for the layer tree to add. options.features Object Features for the layer tree. options.id string Unique identifier for the layer tree. options.type string Type of layer tree ('geojson', 'raster', etc.). "},{"location":"3.1.Funcions_doc/#createnavigationcontroloptions-position-object","title":"createNavigationControl(options, [position]) \u2192 Object","text":"
Creates a navigation control with the provided options.
Kind: global function Returns: Object - - Instance of the created navigation control.
Param Type Default Description options Object Options for the navigation control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addnavigationcontroloptions-position","title":"addNavigationControl(options, [position])","text":"
Adds a navigation control to the map with the provided options.
Kind: global function
Param Type Default Description options Object Options for the navigation control. [position] string\"'top-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#addattributioncontroloptions-position","title":"addAttributionControl(options, [position])","text":"
Adds an attribution control to the map with the provided options.
Kind: global function
Param Type Default Description options Object Options for the attribution control. [position] string\"'bottom-right'\" Position to add the control on the map. "},{"location":"3.1.Funcions_doc/#_dealstylemapsname-string","title":"_dealStyleMaps(name) \u2192 string","text":"
Internal method to handle map styles.
Kind: global function Returns: string - - URL of the map style.
Param Type Description name string Name of the map style. "},{"location":"3.1.Funcions_doc/#addimagelayericgcname","title":"addImageLayerICGC(name)","text":"
Adds an ICGC image layer to the map based on the specified name and year.
Kind: global function
Param Type Description name string The url of the layer. "},{"location":"3.1.Funcions_doc/#addvectorlayericgcidlayer-layerurl-options","title":"addVectorLayerICGC(idLayer, layerUrl, options)","text":"
Adds an ICGC vector layer to the map based on the specified name and year.
Kind: global function
Param Type Description idLayer string The user id for the vector layer. layerUrl string The url of the vector layer. options object Type, position,layout and paint options for the layer "},{"location":"3.1.Funcions_doc/#addfgblayericgcurl-visiblelabel-paintoption","title":"addFGBLayerICGC(url, visibleLabel, paintOption)","text":"
Adds an ICGC FGB layer to the map based on the specified name and year.
Kind: global function
Param Type Description url string The url of the FGB layer. visibleLabel string Visibility of the label (\"visible\" / \"none\"). paintOption object Paint option for the layer "},{"location":"3.1.Funcions_doc/#addterrainicgcresolution-positionbutton","title":"addTerrainICGC(resolution, [positionButton])","text":"
Adds 3D terrain to the map using hillshade.
Kind: global function
Param Type Default Description resolution string resolution of the terrain data: 2m or 5m. [positionButton] string\"'top-right'\" Position to add the button on the map. "},{"location":"3.1.Funcions_doc/#addlegendname","title":"addLegend(name)","text":"
Adds 3D terrain to the map using hillshade.
Kind: global function
Param Type Description name string name of the layer legend to add."},{"location":"4.1.Versio/","title":"4.1.Versio","text":""},{"location":"4.1.Versio/#versionat","title":"Versionat","text":"