mapicgc-gl-js 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -30
- package/dist/mapicgc-gl.css +40 -1
- package/dist/mapicgc-gl.js +9 -9
- package/dist/mapicgc-gl.umd.js +9 -9
- package/docu_Map.md +0 -0
- package/package.json +1 -1
- package/public/mapicgc-gl.css +40 -1
- package/src/config.js +6 -5
- package/src/map/Map.js +124 -10
- package/test/index.html +37 -26
package/README.md
CHANGED
|
@@ -7,57 +7,76 @@
|
|
|
7
7
|
<img src="https://img.shields.io/npm/v/@unitatgeostart/mapicgc-gl-js"></img>
|
|
8
8
|
<img src="https://img.shields.io/twitter/follow/icgcat?style=social"></img>
|
|
9
9
|
</p>
|
|
10
|
-
<p align="center">v. 0.0.24</p>
|
|
11
10
|
|
|
11
|
+
<br>
|
|
12
|
+
Version 0.0.25
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
# What and why?
|
|
15
|
+
The MapICGC GL JS library builds upon the MapLibre GL JS framework, exposing its existing capabilities while introducing new features specific to the MapICGC ecosystem. This library is tailored to seamlessly integrate with the MapICGC Cloud service, offering a comprehensive set of data to enhance web mapping experiences, including vector tiles, satellite raster tiles, DEM with Terrain RGB, and customizable styles with an editor.
|
|
14
16
|
|
|
17
|
+
**Why did we develop a new library?** Our goal is to simplify the development process for MapICGC developers! With MapICGC GL JS, you won't need to load external plugins for basic functionalities, deal with complex data source URLs, or search for syntax to enable 3D terrain every time you embark on a project. All these features are either built-in, loaded dynamically when necessary, or accessible through straightforward functions. While the SDK is opinionated, being closely tied to MapICGC Cloud data, its MapLibre core ensures 100% compatibility with other data sources..
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
The MapICGC GL JS library builds upon the MapLibre GL JS framework, exposing existing capabilities while introducing new features specific to the MapICGC ecosystem. It seamlessly integrates with the MapICGC Cloud service, providing various data types for enhanced web mapping experiences.
|
|
18
|
-
<br><br>
|
|
19
|
-
|
|
20
|
-
## Development Simplification:
|
|
21
|
-
The goal is to simplify development for MapICGC developers. With MapICGC GL JS, there's no need for external plugins or dealing with complex data source URLs. 3D terrain and other features are either built-in, loaded dynamically, or accessible through straightforward functions. The SDK, while tailored to MapICGC Cloud data, ensures compatibility with other sources.
|
|
22
|
-
<br><br>
|
|
23
|
-
|
|
24
|
-
## Comprehensive Data and Functionality:
|
|
25
|
-
MapICGC GL JS offers a comprehensive set of data, including vector tiles, satellite raster tiles, DEM with Terrain RGB, and customizable styles with an editor. It eliminates the need to search for syntax or load external plugins for basic functionalities, providing a user-friendly and efficient development experience.
|
|
26
|
-
<br><br>
|
|
27
|
-
|
|
28
|
-
## API Services Integration:
|
|
29
|
-
MapICGC GL JS provides well-documented and user-friendly wrapper functions for MapICGC Cloud API services. These services include geocoding, static maps, geolocation, and a coordinate reference system search engine for transforming coordinates between different CRSs.
|
|
30
|
-
<br><br>
|
|
31
|
-
|
|
19
|
+
Moreover, MapICGC GL JS provides well-documented and user-friendly wrapper functions for MapICGC Cloud API services, including geocoding, static maps, geolocation, and a coordinate reference system search engine for transforming coordinates between different CRSs.
|
|
32
20
|
|
|
33
21
|
|
|
34
22
|
> 📣 *__Note:__* If you only need the API Client library for headless usage without map display, consider exploring the MapICGC Client JS library for both browser and NodeJS.
|
|
35
23
|
|
|
36
24
|
# Install
|
|
37
|
-
NPM:
|
|
38
25
|
```shell
|
|
39
26
|
npm install --save @mapicgc-gl-js
|
|
40
27
|
```
|
|
41
28
|
|
|
42
|
-
CDN:
|
|
43
|
-
|
|
44
|
-
```html
|
|
45
|
-
<script src="https://betaserver.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.js"></script>
|
|
46
|
-
<link href="https://betaserver.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.css" rel="stylesheet" />
|
|
47
|
-
```
|
|
48
|
-
|
|
49
29
|
# API documentation
|
|
50
30
|
In addition to the details and examples provided in this readme, check out:
|
|
51
31
|
|
|
52
|
-
- [
|
|
32
|
+
- [Documentació de les funcions del Mapa (docu_Map.md)](docu_Map.md)
|
|
33
|
+
- [Documentació del plugin CompareMaps (docu_CompareMaps.md)](docu_CompareMaps.md)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Com afegir la biblioteca a un projecte propi?
|
|
38
|
+
|
|
39
|
+
1. Instal·lar la biblioteca:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm i mapicgc-gl-js
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
2. Afegir les següents línies de codi JS i CSS a l'encapçalament del teu HTML:
|
|
53
46
|
|
|
47
|
+
```html
|
|
48
|
+
|
|
49
|
+
<script src="https://www.unpkg.com/@watergis/maplibre-gl-export@3.0.1/dist/maplibre-gl-export.umd.js"></script>
|
|
54
50
|
|
|
51
|
+
<link href="https://www.unpkg.com/@watergis/maplibre-gl-export@3.0.1/dist/maplibre-gl-export.css" rel="stylesheet" />
|
|
52
|
+
```
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
3. En el script del cos del document, declarar el mapa de la següent manera:
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
58
57
|
import { Map } from 'mapicgc-gl-js';
|
|
59
58
|
|
|
60
59
|
const map = (window.map = new Map({
|
|
61
60
|
style: "topografic",
|
|
62
61
|
}));
|
|
63
|
-
```
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Funcionalitats
|
|
65
|
+
|
|
66
|
+
- Mapa per defecte: Topogràfic ICGC
|
|
67
|
+
- Fons de mapes: Topogràfic, Orto, Híbrid, Gris, Fosc
|
|
68
|
+
|
|
69
|
+
- Afegir capes GeoJson i WMS
|
|
70
|
+
|
|
71
|
+
- Markers
|
|
72
|
+
|
|
73
|
+
- Control Basemaps
|
|
74
|
+
|
|
75
|
+
- Control atribució
|
|
76
|
+
|
|
77
|
+
- Control Capes
|
|
78
|
+
|
|
79
|
+
- Control print
|
|
80
|
+
|
|
81
|
+
- Popups
|
|
82
|
+
|
package/dist/mapicgc-gl.css
CHANGED
|
@@ -748,7 +748,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
|
748
748
|
left: 10px;
|
|
749
749
|
z-index: 1;
|
|
750
750
|
border-radius: 3px;
|
|
751
|
-
width:
|
|
751
|
+
width: auto;
|
|
752
752
|
color: #fff;
|
|
753
753
|
}
|
|
754
754
|
|
|
@@ -1121,3 +1121,42 @@ h4::selection {
|
|
|
1121
1121
|
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiICAgd2lkdGg9IjYwIiAgIGhlaWdodD0iNjAiICAgdmVyc2lvbj0iMS4xIiAgIHZpZXdCb3g9IjAgMCA2MCA2MCIgICBpZD0ic3ZnNTQzNCIgICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkxK2RldmVsK29zeG1lbnUgcjEyOTExIiAgIHNvZGlwb2RpOmRvY25hbWU9Imwtci5zdmciPiAgPG1ldGFkYXRhICAgIC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XJyZW50LWxheWVyPSJzdmc1NDM0IiAgICAgaW5rc2NhcGU6b2JqZWN0LW5vZGVzPSJ0cnVlIiAgICAgaW5rc2NhcGU6c25hcC1zbW9vdGgtbm9kZXM9InRydWUiPiAgICA8aW5rc2NhcGU6Z3JpZCAgICAgICB0eXBlPSJ4eWdyaWQiICAgICAgIGlkPSJncmlkNTk4OSIgLz4gIDwvc29kaXBvZGk6bmFtZWR2aWV3PiAgPHBhdGggICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjFweDtzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjptaXRlcjtzdHJva2Utb3BhY2l0eToxIiAgICAgZD0iTSAyNSAyNCBMIDE2IDMwIEwgMjUgMzYgTCAyNSAyNCB6IE0gMzUgMjQgTCAzNSAzNiBMIDQ0IDMwIEwgMzUgMjQgeiAiICAgICBpZD0icGF0aDU5OTUiIC8+PC9zdmc+);
|
|
1122
1122
|
transform: rotate(90deg);
|
|
1123
1123
|
}
|
|
1124
|
+
|
|
1125
|
+
.distance-container {
|
|
1126
|
+
position: absolute;
|
|
1127
|
+
top: 0px;
|
|
1128
|
+
left: 45%;
|
|
1129
|
+
z-index: 1;
|
|
1130
|
+
display: flex;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.distance-container > * {
|
|
1134
|
+
line-height: 18px;
|
|
1135
|
+
display: flex;
|
|
1136
|
+
height: 17px;
|
|
1137
|
+
margin: 0 auto;
|
|
1138
|
+
padding: 2px;
|
|
1139
|
+
padding-bottom: 1.5px;
|
|
1140
|
+
left: 45%;
|
|
1141
|
+
border: none;
|
|
1142
|
+
border-radius: 3px;
|
|
1143
|
+
font-size: 12px;
|
|
1144
|
+
text-align: center;
|
|
1145
|
+
color: #222;
|
|
1146
|
+
background: hsla(0, 0%, 100%, 0.849);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
#xButton {
|
|
1151
|
+
width: fit-content;
|
|
1152
|
+
z-index: 1;
|
|
1153
|
+
cursor: pointer;
|
|
1154
|
+
color: #fff;
|
|
1155
|
+
font-size: 14px;
|
|
1156
|
+
line-height: 18px;
|
|
1157
|
+
border-radius: 0px;
|
|
1158
|
+
background-color: crimson;
|
|
1159
|
+
}
|
|
1160
|
+
#xButton:hover{
|
|
1161
|
+
background-color: rgb(126, 12, 12);
|
|
1162
|
+
}
|