mapicgc-gl-js 0.0.41 → 0.0.43
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 +59 -26
- package/dist/mapicgc-gl.css +57 -15
- package/dist/mapicgc-gl.js +833 -244
- package/dist/mapicgc-gl.umd.js +833 -244
- package/docu_Map.md +0 -0
- package/nodeSetConfig.js +45 -9
- package/package.json +10 -15
- package/public/mapicgc-gl.css +57 -15
- package/src/config.js +809 -809
- package/src/configNode.js +809 -809
- package/src/constants/Layers.js +165 -155
- package/src/constants/Styles.js +12 -12
- package/src/constants/Terrains.js +7 -7
- package/src/controls/LogoControl.js +57 -0
- package/src/controls/MouseCoordinatesControl.js +42 -0
- package/src/map/Map.js +1421 -1136
- package/test/exemples/InstamapsExport.gpkg +0 -0
- package/test/exemples/addBasemap.html +52 -0
- package/test/exemples/addCompare.html +75 -0
- package/test/exemples/addControl.html +62 -0
- package/test/exemples/addFGBLayerICGC.html +55 -0
- package/test/exemples/addFeatureQuery.html +64 -0
- package/test/exemples/addGeocoderICGC.html +47 -0
- package/test/exemples/addGeopackage.html +54 -0
- package/test/exemples/addICGCTerrain.html +45 -0
- package/test/exemples/addImageLayerICGC.html +44 -0
- package/test/exemples/addLayerGeojson.html +74 -0
- package/test/exemples/addLayerTree.html +99 -0
- package/test/exemples/addLogo.html +57 -0
- package/test/exemples/addMapStyle.html +45 -0
- package/test/exemples/addMarker.html +54 -0
- package/test/exemples/addMouseCoordinateControl.html +39 -0
- package/test/exemples/addVectorLayerICGC.html +60 -0
- package/test/exemples/advancedExemple.html +98 -0
- package/test/exemples/changeSymbolColor.html +59 -0
- package/test/exemples/fetchData.html +64 -0
- package/test/exemples/fetchDataAndMenu.html +56 -0
- package/{exemples/orto3d.html → test/exemples/styleOrto3D.html} +11 -43
- package/api.md +0 -3
- package/dist/vite.svg +0 -1
- package/docu_CompareMaps.md +0 -0
- package/exemples/compare.html +0 -114
- package/exemples/measure.html +0 -94
- package/public/vite.svg +0 -1
- package/test/Proposa_DAC_min.geojson +0 -35075
- package/test/index.html +0 -349
- /package/{LICENSE.md → LICENSE.txt} +0 -0
package/README.md
CHANGED
|
@@ -1,65 +1,82 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://tilemaps.icgc.cat/cdn/
|
|
2
|
+
<img src="https://tilemaps.icgc.cat/cdn/images/logo2.png" alt="MapICGC Logo" width="400px">
|
|
3
3
|
</p>
|
|
4
4
|
<p align="center">
|
|
5
|
-
<img src="https://tilemaps.icgc.cat/cdn/
|
|
6
|
-
<img src="https://
|
|
7
|
-
<
|
|
8
|
-
<
|
|
5
|
+
<img src="https://tilemaps.icgc.cat/cdn/images/JS-logo.svg" width="20px">
|
|
6
|
+
<img src="https://badge.fury.io/js/mapicgc-gl-js.svg">
|
|
7
|
+
<a href="https://twitter.com/icgcat" target="_blank">
|
|
8
|
+
<img src="https://img.shields.io/twitter/follow/icgcat?style=social">
|
|
9
|
+
</a>
|
|
9
10
|
</p>
|
|
10
11
|
|
|
11
|
-
|
|
12
12
|
<br>
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
# MapICGC GL JS
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
> 🌠 __MAPLIBRE GL JS version:__ 4.1.2
|
|
17
18
|
|
|
18
|
-
The MapICGC GL JS library builds upon the MapLibre GL JS
|
|
19
|
+
The MapICGC GL JS library builds upon the open-source library [**MapLibre GL JS**](https://github.com/maplibre/maplibre-gl-js), 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.
|
|
19
20
|
|
|
20
21
|
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.
|
|
21
22
|
|
|
22
23
|
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.
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
|
|
26
27
|
|
|
27
28
|
<br>
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
## Getting Started
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
### NPM
|
|
33
|
+
|
|
34
|
+
1. Install the library:
|
|
33
35
|
```bash
|
|
34
36
|
npm i mapicgc-gl-js
|
|
35
|
-
```
|
|
36
|
-
- CDN
|
|
37
37
|
|
|
38
|
+
2. Import the library:
|
|
39
|
+
```html
|
|
40
|
+
<script>
|
|
41
|
+
import { Map,Styles } from 'mapicgc-gl-js';
|
|
42
|
+
|
|
43
|
+
const map = Map({
|
|
44
|
+
container: 'map',
|
|
45
|
+
style: Styles.LIGHT,
|
|
46
|
+
center: [2.1464, 41.306],
|
|
47
|
+
zoom: 7.4,
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
```
|
|
51
|
+
### CDN
|
|
52
|
+
|
|
53
|
+
1. Include the JavaScript and CSS files in the `<head>` of your HTML file.:
|
|
38
54
|
```html
|
|
39
55
|
<script src="https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.js"></script>
|
|
40
56
|
<link href="https://tilemaps.icgc.cat/cdn/mapicgc-gl-js/mapicgc-gl.css" rel="stylesheet" />
|
|
41
57
|
```
|
|
42
58
|
|
|
43
|
-
2.
|
|
59
|
+
2. Include the following code in the `<body>` of your HTML file.:
|
|
44
60
|
|
|
45
|
-
```html
|
|
61
|
+
```html
|
|
46
62
|
<div id="map"></div>
|
|
47
63
|
<script>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const map = Map({
|
|
64
|
+
const map = mapicgcgl.Map({
|
|
51
65
|
container: 'map',
|
|
52
|
-
style: mapicgcgl.Styles.LIGHT,
|
|
53
|
-
center: [2.1464, 41.306],
|
|
54
|
-
zoom: 7.4,
|
|
66
|
+
style: mapicgcgl.Styles.LIGHT,
|
|
67
|
+
center: [2.1464, 41.306],
|
|
68
|
+
zoom: 7.4,
|
|
55
69
|
});
|
|
56
70
|
</script>
|
|
57
71
|
```
|
|
72
|
+
|
|
73
|
+
Result:
|
|
74
|
+
|
|
58
75
|
<div align="center">
|
|
59
|
-
<a title="Link to CodePen" href="https://codepen.io/unitatgeostart/pen/eYXWyqd" target="_blank"><img src="https://tilemaps.icgc.cat/cdn
|
|
76
|
+
<a title="Link to CodePen" href="https://codepen.io/unitatgeostart/pen/eYXWyqd" target="_blank"><img src="https://tilemaps.icgc.cat/cdn//images/map1.png"></img></a></div>
|
|
60
77
|
<br>
|
|
61
78
|
|
|
62
|
-
|
|
79
|
+
## Documentation
|
|
63
80
|
|
|
64
81
|
Full documentation for this library is <a href="https://autogitlab.icgc.local/geostarters/icgc/mapicgc/mapicgc-doc" target="_blank">available here</a>.
|
|
65
82
|
|
|
@@ -68,5 +85,21 @@ Check out the features through <a href="https://codepen.io/collection/mrvVZd" ta
|
|
|
68
85
|
|
|
69
86
|
<br>
|
|
70
87
|
|
|
71
|
-
|
|
72
|
-
|
|
88
|
+
## Dependencies
|
|
89
|
+
|
|
90
|
+
MapICGC GL JS integrates the following libraries:
|
|
91
|
+
- <a href="https://github.com/maplibre/maplibre-gl-compare" target="_blank"> @maplibre/maplibre-gl-compare </a>
|
|
92
|
+
- <a href="https://github.com/maplibre/maplibre-gl-geocoder" target="_blank"> @maplibre/maplibre-gl-geocoder </a>
|
|
93
|
+
- <a href="https://www.npmjs.com/package/@watergis/maplibre-gl-export" target="_blank"> @watergis/maplibre-gl-export </a>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
<br>
|
|
97
|
+
|
|
98
|
+
## Developed by:
|
|
99
|
+
|
|
100
|
+
<a href="https://www.icgc.cat/" target="_blank"><img src="https://tilemaps.icgc.cat/cdn/logos/ICGC_color_norma.svg" alt="ICGC Logo" width="150"></img></a>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
**MAPICGC GL JS** is licensed under the [3-Clause BSD license](./LICENSE.txt).
|
package/dist/mapicgc-gl.css
CHANGED
|
@@ -1093,22 +1093,21 @@ h4::selection {
|
|
|
1093
1093
|
margin-top: 15vh;
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
+
.coordControl{
|
|
1096
1097
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
color: #222;
|
|
1111
|
-
background: hsla(0, 0%, 100%, 0.849);
|
|
1098
|
+
|
|
1099
|
+
bottom: 0;
|
|
1100
|
+
height: auto;
|
|
1101
|
+
margin: 0 auto;
|
|
1102
|
+
padding: 5px;
|
|
1103
|
+
border: 1px solid #cccccc;
|
|
1104
|
+
left: 45%;
|
|
1105
|
+
border: none;
|
|
1106
|
+
border-radius: 3px;
|
|
1107
|
+
font-size: 0.85em;
|
|
1108
|
+
text-align: center;
|
|
1109
|
+
color: #333;
|
|
1110
|
+
background: hsla(0, 0%, 100%, 0.849);
|
|
1112
1111
|
}
|
|
1113
1112
|
@media (max-width: 700px) {
|
|
1114
1113
|
.coordControl{
|
|
@@ -1519,5 +1518,48 @@ h4::selection {
|
|
|
1519
1518
|
/* min-width: 130px; */
|
|
1520
1519
|
/* text-align: -webkit-center; */
|
|
1521
1520
|
}
|
|
1521
|
+
#legendContainer {
|
|
1522
|
+
position: absolute;
|
|
1523
|
+
top: 20px;
|
|
1524
|
+
right: 76px;
|
|
1525
|
+
background-color: white;
|
|
1526
|
+
padding: 10px;
|
|
1527
|
+
border: 1px solid #ccc;
|
|
1528
|
+
border-radius: 5px;
|
|
1529
|
+
z-index: 1000;
|
|
1530
|
+
overflow-y: scroll;
|
|
1531
|
+
cursor: grab;
|
|
1532
|
+
};
|
|
1533
|
+
#toggleLegend {
|
|
1534
|
+
position: absolute;
|
|
1535
|
+
top: 20px;
|
|
1536
|
+
right: 20px;
|
|
1537
|
+
background-color: #00ab2d;
|
|
1538
|
+
color: white;
|
|
1539
|
+
width: 40px;
|
|
1540
|
+
height: 40px;
|
|
1541
|
+
border-radius: 50%;
|
|
1542
|
+
text-align: center;
|
|
1543
|
+
line-height: 40px;
|
|
1544
|
+
cursor: pointer;
|
|
1545
|
+
z-index: 1000;
|
|
1546
|
+
};
|
|
1547
|
+
#geocoder-container {
|
|
1548
|
+
margin: 20px;
|
|
1549
|
+
position: absolute;
|
|
1550
|
+
top: 50px;
|
|
1551
|
+
right: 20px;
|
|
1552
|
+
};
|
|
1553
|
+
|
|
1554
|
+
#results {
|
|
1555
|
+
margin-top: 10px;
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
.divLogos{
|
|
1559
|
+
display: flex;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
|
|
1522
1564
|
|
|
1523
1565
|
}
|