@cronapp/openstreetmap-plugin 4.3.0

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/cronapp.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "postUpdate": {
3
+ "angularJs": {
4
+ "includes": [
5
+ {
6
+ "file": "index.html",
7
+ "script": "https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",
8
+ "type": "script"
9
+ },
10
+ {
11
+ "file": "index.html",
12
+ "script": "node_modules/@cronapp/openstreetmap-plugin/dist/openstreetmap.cronapi.js",
13
+ "type": "script"
14
+ },
15
+ {
16
+ "file": "index.html",
17
+ "script": "https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",
18
+ "type": "stylesheet"
19
+ }
20
+ ]
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "osm_initializeMap": "Initialize Map",
3
+ "osm_initializeMapDescription": "Initializes the map in the given element ID",
4
+ "osm_setView": "Set View",
5
+ "osm_setViewDescription": "Sets the center and zoom of the map",
6
+ "osm_addMarker": "Add Marker",
7
+ "osm_addMarkerDescription": "Adds a marker to the map",
8
+ "osm_addTileLayer": "Add Tile Layer",
9
+ "osm_addTileLayerDescription": "Adds a custom tile layer to the map",
10
+ "osm_zoomIn": "Zoom In",
11
+ "osm_zoomInDescription": "Increases map zoom level",
12
+ "osm_zoomOut": "Zoom Out",
13
+ "osm_zoomOutDescription": "Decreases map zoom level"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "osm_initializeMap": "Inicializar Mapa",
3
+ "osm_initializeMapDescription": "Inicializa o mapa no elemento com o ID fornecido",
4
+ "osm_setView": "Definir Visualização",
5
+ "osm_setViewDescription": "Define o centro e o zoom do mapa",
6
+ "osm_addMarker": "Adicionar Marcador",
7
+ "osm_addMarkerDescription": "Adiciona um marcador ao mapa",
8
+ "osm_addTileLayer": "Adicionar Camada de Tile",
9
+ "osm_addTileLayerDescription": "Adiciona uma camada personalizada ao mapa",
10
+ "osm_zoomIn": "Aproximar Zoom",
11
+ "osm_zoomInDescription": "Aumenta o nível de zoom",
12
+ "osm_zoomOut": "Afastar Zoom",
13
+ "osm_zoomOutDescription": "Diminui o nível de zoom"
14
+ }
@@ -0,0 +1,101 @@
1
+ (function () {
2
+ 'use strict';
3
+
4
+ this.cronapi = this.cronapi || {};
5
+ this.cronapi.openstreetmap = this.cronapi.openstreetmap || {};
6
+
7
+ /**
8
+ * @categoryName OpenStreetMap
9
+ */
10
+
11
+ /**
12
+ * @type function
13
+ * @name {{osm_initializeMap}}
14
+ * @nameTags mapa|iniciar|openstreetmap
15
+ * @description {{osm_initializeMapDescription}}
16
+ * @param {ObjectType.STRING} elementId ID do elemento
17
+ * @returns {ObjectType.VOID}
18
+ */
19
+ this.cronapi.openstreetmap.initializeMap = function(elementId) {
20
+ const map = L.map(elementId).setView([0, 0], 2);
21
+ this.cronapi.openstreetmap._mapInstance = map;
22
+ };
23
+
24
+ /**
25
+ * @type function
26
+ * @name {{osm_setView}}
27
+ * @nameTags mapa|centro|zoom
28
+ * @description {{osm_setViewDescription}}
29
+ * @param {ObjectType.DECIMAL} latitude Latitude
30
+ * @param {ObjectType.DECIMAL} longitude Longitude
31
+ * @param {ObjectType.LONG} zoom Zoom
32
+ * @returns {ObjectType.VOID}
33
+ */
34
+ this.cronapi.openstreetmap.setView = function(latitude, longitude, zoom) {
35
+ const map = this.cronapi.openstreetmap._mapInstance;
36
+ if (map) {
37
+ map.setView([latitude, longitude], zoom);
38
+ }
39
+ };
40
+
41
+ /**
42
+ * @type function
43
+ * @name {{osm_addMarker}}
44
+ * @nameTags mapa|marcador|ponto
45
+ * @description {{osm_addMarkerDescription}}
46
+ * @param {ObjectType.DECIMAL} latitude Latitude
47
+ * @param {ObjectType.DECIMAL} longitude Longitude
48
+ * @returns {ObjectType.VOID}
49
+ */
50
+ this.cronapi.openstreetmap.addMarker = function(latitude, longitude) {
51
+ const map = this.cronapi.openstreetmap._mapInstance;
52
+ if (map) {
53
+ L.marker([latitude, longitude]).addTo(map);
54
+ }
55
+ };
56
+
57
+ /**
58
+ * @type function
59
+ * @name {{osm_addTileLayer}}
60
+ * @nameTags mapa|camada|tile
61
+ * @description {{osm_addTileLayerDescription}}
62
+ * @param {ObjectType.STRING} url URL da camada
63
+ * @returns {ObjectType.VOID}
64
+ */
65
+ this.cronapi.openstreetmap.addTileLayer = function(url) {
66
+ const map = this.cronapi.openstreetmap._mapInstance;
67
+ if (map) {
68
+ L.tileLayer(url, {
69
+ attribution: '© OpenStreetMap contributors'
70
+ }).addTo(map);
71
+ }
72
+ };
73
+
74
+ /**
75
+ * @type function
76
+ * @name {{osm_zoomIn}}
77
+ * @nameTags mapa|zoom in|aproximar
78
+ * @description {{osm_zoomInDescription}}
79
+ * @returns {ObjectType.VOID}
80
+ */
81
+ this.cronapi.openstreetmap.zoomIn = function() {
82
+ const map = this.cronapi.openstreetmap._mapInstance;
83
+ if (map) {
84
+ map.zoomIn();
85
+ }
86
+ };
87
+
88
+ /**
89
+ * @type function
90
+ * @name {{osm_zoomOut}}
91
+ * @nameTags mapa|zoom out|afastar
92
+ * @description {{osm_zoomOutDescription}}
93
+ * @returns {ObjectType.VOID}
94
+ */
95
+ this.cronapi.openstreetmap.zoomOut = function() {
96
+ const map = this.cronapi.openstreetmap._mapInstance;
97
+ if (map) {
98
+ map.zoomOut();
99
+ }
100
+ };
101
+ }).bind(window)();
package/gulpfile.js ADDED
@@ -0,0 +1,14 @@
1
+ var gulp = require("gulp");
2
+
3
+ // Minify causa problema na leitura das tags cronapi, usar minify será feito futuramente como melhoria
4
+ gulp.task("copy-js", function() {
5
+ return gulp.src("js/**").pipe(gulp.dest("dist/"));
6
+ });
7
+
8
+ gulp.task("i18n", function() {
9
+ return gulp.src("i18n/**").pipe(gulp.dest("dist/i18n/"));
10
+ });
11
+
12
+ gulp.task('build', gulp.series('copy-js', 'i18n'));
13
+
14
+ gulp.task('default', gulp.series('build'));
@@ -0,0 +1,14 @@
1
+ {
2
+ "osm_initializeMap": "Initialize Map",
3
+ "osm_initializeMapDescription": "Initializes the map in the given element ID",
4
+ "osm_setView": "Set View",
5
+ "osm_setViewDescription": "Sets the center and zoom of the map",
6
+ "osm_addMarker": "Add Marker",
7
+ "osm_addMarkerDescription": "Adds a marker to the map",
8
+ "osm_addTileLayer": "Add Tile Layer",
9
+ "osm_addTileLayerDescription": "Adds a custom tile layer to the map",
10
+ "osm_zoomIn": "Zoom In",
11
+ "osm_zoomInDescription": "Increases map zoom level",
12
+ "osm_zoomOut": "Zoom Out",
13
+ "osm_zoomOutDescription": "Decreases map zoom level"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "osm_initializeMap": "Inicializar Mapa",
3
+ "osm_initializeMapDescription": "Inicializa o mapa no elemento com o ID fornecido",
4
+ "osm_setView": "Definir Visualização",
5
+ "osm_setViewDescription": "Define o centro e o zoom do mapa",
6
+ "osm_addMarker": "Adicionar Marcador",
7
+ "osm_addMarkerDescription": "Adiciona um marcador ao mapa",
8
+ "osm_addTileLayer": "Adicionar Camada de Tile",
9
+ "osm_addTileLayerDescription": "Adiciona uma camada personalizada ao mapa",
10
+ "osm_zoomIn": "Aproximar Zoom",
11
+ "osm_zoomInDescription": "Aumenta o nível de zoom",
12
+ "osm_zoomOut": "Afastar Zoom",
13
+ "osm_zoomOutDescription": "Diminui o nível de zoom"
14
+ }
@@ -0,0 +1,101 @@
1
+ (function () {
2
+ 'use strict';
3
+
4
+ this.cronapi = this.cronapi || {};
5
+ this.cronapi.openstreetmap = this.cronapi.openstreetmap || {};
6
+
7
+ /**
8
+ * @categoryName OpenStreetMap
9
+ */
10
+
11
+ /**
12
+ * @type function
13
+ * @name {{osm_initializeMap}}
14
+ * @nameTags mapa|iniciar|openstreetmap
15
+ * @description {{osm_initializeMapDescription}}
16
+ * @param {ObjectType.STRING} elementId ID do elemento
17
+ * @returns {ObjectType.VOID}
18
+ */
19
+ this.cronapi.openstreetmap.initializeMap = function(elementId) {
20
+ const map = L.map(elementId).setView([0, 0], 2);
21
+ this.cronapi.openstreetmap._mapInstance = map;
22
+ };
23
+
24
+ /**
25
+ * @type function
26
+ * @name {{osm_setView}}
27
+ * @nameTags mapa|centro|zoom
28
+ * @description {{osm_setViewDescription}}
29
+ * @param {ObjectType.DECIMAL} latitude Latitude
30
+ * @param {ObjectType.DECIMAL} longitude Longitude
31
+ * @param {ObjectType.LONG} zoom Zoom
32
+ * @returns {ObjectType.VOID}
33
+ */
34
+ this.cronapi.openstreetmap.setView = function(latitude, longitude, zoom) {
35
+ const map = this.cronapi.openstreetmap._mapInstance;
36
+ if (map) {
37
+ map.setView([latitude, longitude], zoom);
38
+ }
39
+ };
40
+
41
+ /**
42
+ * @type function
43
+ * @name {{osm_addMarker}}
44
+ * @nameTags mapa|marcador|ponto
45
+ * @description {{osm_addMarkerDescription}}
46
+ * @param {ObjectType.DECIMAL} latitude Latitude
47
+ * @param {ObjectType.DECIMAL} longitude Longitude
48
+ * @returns {ObjectType.VOID}
49
+ */
50
+ this.cronapi.openstreetmap.addMarker = function(latitude, longitude) {
51
+ const map = this.cronapi.openstreetmap._mapInstance;
52
+ if (map) {
53
+ L.marker([latitude, longitude]).addTo(map);
54
+ }
55
+ };
56
+
57
+ /**
58
+ * @type function
59
+ * @name {{osm_addTileLayer}}
60
+ * @nameTags mapa|camada|tile
61
+ * @description {{osm_addTileLayerDescription}}
62
+ * @param {ObjectType.STRING} url URL da camada
63
+ * @returns {ObjectType.VOID}
64
+ */
65
+ this.cronapi.openstreetmap.addTileLayer = function(url) {
66
+ const map = this.cronapi.openstreetmap._mapInstance;
67
+ if (map) {
68
+ L.tileLayer(url, {
69
+ attribution: '© OpenStreetMap contributors'
70
+ }).addTo(map);
71
+ }
72
+ };
73
+
74
+ /**
75
+ * @type function
76
+ * @name {{osm_zoomIn}}
77
+ * @nameTags mapa|zoom in|aproximar
78
+ * @description {{osm_zoomInDescription}}
79
+ * @returns {ObjectType.VOID}
80
+ */
81
+ this.cronapi.openstreetmap.zoomIn = function() {
82
+ const map = this.cronapi.openstreetmap._mapInstance;
83
+ if (map) {
84
+ map.zoomIn();
85
+ }
86
+ };
87
+
88
+ /**
89
+ * @type function
90
+ * @name {{osm_zoomOut}}
91
+ * @nameTags mapa|zoom out|afastar
92
+ * @description {{osm_zoomOutDescription}}
93
+ * @returns {ObjectType.VOID}
94
+ */
95
+ this.cronapi.openstreetmap.zoomOut = function() {
96
+ const map = this.cronapi.openstreetmap._mapInstance;
97
+ if (map) {
98
+ map.zoomOut();
99
+ }
100
+ };
101
+ }).bind(window)();
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@cronapp/openstreetmap-plugin",
3
+ "version": "4.3.0",
4
+ "description": "Plugin OpenStreetMap",
5
+ "keywords": [
6
+ "cronapp",
7
+ "openstreetmap",
8
+ "plugin",
9
+ "map",
10
+ "leaflet"
11
+ ],
12
+ "author": "Cronapp Studio",
13
+ "license": "ISC",
14
+ "scripts": {
15
+ "build": "gulp"
16
+ },
17
+ "devDependencies": {
18
+ "gulp": "^5.0.0"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }