@mapcreator/mapcreator-gl 1.0.4

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/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@mapcreator/mapcreator-gl",
3
+ "version": "1.0.4",
4
+ "description": "Mapcreator interactive maps library",
5
+ "main": "dist/lib/lib.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "start": "npm run fixMaplibreImport && npm run updateBrowserRegexp && webpack serve --mode development",
10
+ "serve": "npm run start",
11
+ "serve:lib": "npm run fixMaplibreImport && npm run updateBrowserRegexp && webpack serve --mode development --env ENV=production --config ./webpack.config.lib.js",
12
+ "build": "npm run fixMaplibreImport && npm run updateBrowserRegexp && webpack",
13
+ "build:lib": "npm run fixMaplibreImport && npm run updateBrowserRegexp && webpack --config ./webpack.config.lib.js --mode=production --env ENV=production",
14
+ "preview": "npm run build && http-server dist",
15
+ "lint": "npx eslint 'src/**/*.ts'",
16
+ "lint:fix": "npx eslint 'src/**/*.ts' --fix",
17
+ "prettier": "prettier --check \"./src/**/*.{ts,js,json,html,css,scss}\"",
18
+ "prettier:write": "prettier --write \"./src/**/*.{ts,js,json,html,css,scss}\"",
19
+ "updateBrowserRegexp": "echo \"export const browserRegex = $(browserslist-useragent-regexp --allowHigherVersions --ignoreMinor --ignorePatch);\" > .browserslist.exp.ts",
20
+ "fixMaplibreImport": "sed -i.bak '/\"type\": \"module\"/g' node_modules/@mapcreator/maplibre-gl/package.json"
21
+ },
22
+ "author": "Mapcreator",
23
+ "license": "ISC",
24
+ "devDependencies": {
25
+ "@babel/eslint-parser": "^7.21.8",
26
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
27
+ "@babel/plugin-proposal-json-strings": "^7.18.6",
28
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
29
+ "@babel/plugin-syntax-import-meta": "^7.10.4",
30
+ "@babel/polyfill": "^7.12.1",
31
+ "@babel/preset-env": "^7.22.4",
32
+ "@mapcreator/eslint-config": "^3.1.0",
33
+ "@mapcreator/helpers": "^1.6.0",
34
+ "@mapcreator/maplibre-gl": "2.4.0-mc.4",
35
+ "@sentry/browser": "^7.53.1",
36
+ "@types/node": "^20.10.6",
37
+ "@types/webpack": "^5.28.5",
38
+ "@types/webpack-env": "^1.18.4",
39
+ "@typescript-eslint/eslint-plugin": "^6.16.0",
40
+ "@typescript-eslint/parser": "^6.16.0",
41
+ "autoprefixer": "^10.4.14",
42
+ "babel-loader": "^9.1.2",
43
+ "browserslist-useragent-regexp": "^4.0.0",
44
+ "case": "^1.6.3",
45
+ "clean-webpack-plugin": "^4.0.0",
46
+ "copy-webpack-plugin": "^11.0.0",
47
+ "css-loader": "^5.2.7",
48
+ "cssnano": "^6.0.1",
49
+ "d3-geo": "^3.1.0",
50
+ "d3-interpolate": "^3.0.1",
51
+ "d3-scale": "^4.0.2",
52
+ "dotenv": "^16.0.3",
53
+ "eslint": "^8.41.0",
54
+ "html-webpack-plugin": "^5.5.1",
55
+ "http-server": "^14.1.1",
56
+ "leaflet": "^1.9.4",
57
+ "leaflet.locatecontrol": "^0.79.0",
58
+ "leaflet.markercluster": "1.5.3",
59
+ "mini-css-extract-plugin": "^2.7.6",
60
+ "postcss-loader": "^7.3.2",
61
+ "postcss-nested": "^6.0.1",
62
+ "prettier": "^2.8.8",
63
+ "raw-loader": "^4.0.2",
64
+ "sanitize-html": "^2.10.0",
65
+ "terser-webpack-plugin": "^5.3.9",
66
+ "translate-js": "^1.3.0",
67
+ "ts-loader": "^9.5.1",
68
+ "ts-node": "^10.9.2",
69
+ "typescript": "^5.3.3",
70
+ "url": "^0.11.3",
71
+ "url-loader": "^4.1.1",
72
+ "webpack": "^5.84.1",
73
+ "webpack-bundle-analyzer": "^4.9.0",
74
+ "webpack-cli": "^5.1.1",
75
+ "webpack-dev-server": "^4.15.0",
76
+ "whatwg-fetch": "^3.6.2"
77
+ }
78
+ }
package/readme.md ADDED
@@ -0,0 +1,29 @@
1
+ [Mapcreator](https://mapcreator.io/) interactive maps library. Uses [Maplibre GL JS](https://maplibre.org) internally and adds Mapcreator-specific features to it.
2
+
3
+ ## Installation
4
+
5
+ ```
6
+ npm i --save mapcreator-gl
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```javascript
12
+ // Import library scripts
13
+ import { init } from 'mapcreator-gl';
14
+
15
+ // Import library styles
16
+ import 'mapcreator-gl/dist/lib/style.css';
17
+
18
+ // Initialize the map
19
+ const map = await init({
20
+ container: '<map container element or its id>',
21
+ jobId: '<interactive map id>',
22
+ accessToken: '<mapcreator access token>',
23
+ });
24
+
25
+ // map is now an instance of MapLibre GL JS:
26
+ //
27
+ // map.setZoom(10);
28
+ // map.getZoom();
29
+ ```