@inlog/inlog-maps 1.0.0 → 1.1.0-test
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/DOCUMENTATION.md +1813 -0
- package/README.md +46 -591
- package/_bundles/inlog-maps.js +3 -0
- package/_bundles/inlog-maps.js.LICENSE.txt +20 -0
- package/_bundles/inlog-maps.js.map +1 -0
- package/_bundles/inlog-maps.min.js +3 -0
- package/_bundles/inlog-maps.min.js.LICENSE.txt +20 -0
- package/_bundles/inlog-maps.min.js.map +1 -0
- package/bower.json +23 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.js +47 -0
- package/lib/index.js.map +1 -0
- package/lib/map.d.ts +519 -0
- package/lib/map.js +1137 -0
- package/lib/map.js.map +1 -0
- package/lib/models/apis/google/google-circles.d.ts +18 -0
- package/lib/models/apis/google/google-circles.js +134 -0
- package/lib/models/apis/google/google-circles.js.map +1 -0
- package/lib/models/apis/google/google-geojson.d.ts +9 -0
- package/lib/models/apis/google/google-geojson.js +73 -0
- package/lib/models/apis/google/google-geojson.js.map +1 -0
- package/lib/models/apis/google/google-map.d.ts +16 -0
- package/lib/models/apis/google/google-map.js +174 -0
- package/lib/models/apis/google/google-map.js.map +1 -0
- package/lib/models/apis/google/google-markers.d.ts +29 -0
- package/lib/models/apis/google/google-markers.js +325 -0
- package/lib/models/apis/google/google-markers.js.map +1 -0
- package/lib/models/apis/google/google-overlay.d.ts +11 -0
- package/lib/models/apis/google/google-overlay.js +102 -0
- package/lib/models/apis/google/google-overlay.js.map +1 -0
- package/lib/models/apis/google/google-polygons.d.ts +29 -0
- package/lib/models/apis/google/google-polygons.js +301 -0
- package/lib/models/apis/google/google-polygons.js.map +1 -0
- package/lib/models/apis/google/google-polylines.d.ts +55 -0
- package/lib/models/apis/google/google-polylines.js +707 -0
- package/lib/models/apis/google/google-polylines.js.map +1 -0
- package/lib/models/apis/google/google-popup.d.ts +10 -0
- package/lib/models/apis/google/google-popup.js +59 -0
- package/lib/models/apis/google/google-popup.js.map +1 -0
- package/lib/models/apis/googleMaps.d.ts +97 -0
- package/lib/models/apis/googleMaps.js +449 -0
- package/lib/models/apis/googleMaps.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-circle.d.ts +18 -0
- package/lib/models/apis/leaflet/leaflet-circle.js +163 -0
- package/lib/models/apis/leaflet/leaflet-circle.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-geojson.d.ts +9 -0
- package/lib/models/apis/leaflet/leaflet-geojson.js +73 -0
- package/lib/models/apis/leaflet/leaflet-geojson.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-map.d.ts +16 -0
- package/lib/models/apis/leaflet/leaflet-map.js +140 -0
- package/lib/models/apis/leaflet/leaflet-map.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-markers.d.ts +29 -0
- package/lib/models/apis/leaflet/leaflet-markers.js +294 -0
- package/lib/models/apis/leaflet/leaflet-markers.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-overlay.d.ts +10 -0
- package/lib/models/apis/leaflet/leaflet-overlay.js +35 -0
- package/lib/models/apis/leaflet/leaflet-overlay.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-polygons.d.ts +23 -0
- package/lib/models/apis/leaflet/leaflet-polygons.js +211 -0
- package/lib/models/apis/leaflet/leaflet-polygons.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-polylines.d.ts +55 -0
- package/lib/models/apis/leaflet/leaflet-polylines.js +721 -0
- package/lib/models/apis/leaflet/leaflet-polylines.js.map +1 -0
- package/lib/models/apis/leaflet/leaflet-popup.d.ts +11 -0
- package/lib/models/apis/leaflet/leaflet-popup.js +74 -0
- package/lib/models/apis/leaflet/leaflet-popup.js.map +1 -0
- package/lib/models/apis/leaflet.d.ts +99 -0
- package/lib/models/apis/leaflet.js +464 -0
- package/lib/models/apis/leaflet.js.map +1 -0
- package/lib/models/apis/mapFunctions.d.ts +85 -0
- package/lib/models/apis/mapFunctions.js +2 -0
- package/lib/models/apis/mapFunctions.js.map +1 -0
- package/lib/models/dto/event-type.d.ts +33 -0
- package/lib/models/dto/event-type.js +39 -0
- package/lib/models/dto/event-type.js.map +1 -0
- package/lib/models/dto/map-type.d.ts +4 -0
- package/lib/models/dto/map-type.js +6 -0
- package/lib/models/dto/map-type.js.map +1 -0
- package/lib/models/dto/polyline-type.d.ts +5 -0
- package/lib/models/dto/polyline-type.js +7 -0
- package/lib/models/dto/polyline-type.js.map +1 -0
- package/lib/models/features/circle/circle-alter-options.d.ts +12 -0
- package/lib/models/features/circle/circle-alter-options.js +14 -0
- package/lib/models/features/circle/circle-alter-options.js.map +1 -0
- package/lib/models/features/circle/circle-options.d.ts +15 -0
- package/lib/models/features/circle/circle-options.js +19 -0
- package/lib/models/features/circle/circle-options.js.map +1 -0
- package/lib/models/features/events/event-return.d.ts +4 -0
- package/lib/models/features/events/event-return.js +8 -0
- package/lib/models/features/events/event-return.js.map +1 -0
- package/lib/models/features/geojson/geojson-options.d.ts +5 -0
- package/lib/models/features/geojson/geojson-options.js +9 -0
- package/lib/models/features/geojson/geojson-options.js.map +1 -0
- package/lib/models/features/marker/circle-marker-options.d.ts +9 -0
- package/lib/models/features/marker/circle-marker-options.js +12 -0
- package/lib/models/features/marker/circle-marker-options.js.map +1 -0
- package/lib/models/features/marker/circle-marker-style.d.ts +8 -0
- package/lib/models/features/marker/circle-marker-style.js +12 -0
- package/lib/models/features/marker/circle-marker-style.js.map +1 -0
- package/lib/models/features/marker/marker-alter-options.d.ts +8 -0
- package/lib/models/features/marker/marker-alter-options.js +10 -0
- package/lib/models/features/marker/marker-alter-options.js.map +1 -0
- package/lib/models/features/marker/marker-icon.d.ts +6 -0
- package/lib/models/features/marker/marker-icon.js +10 -0
- package/lib/models/features/marker/marker-icon.js.map +1 -0
- package/lib/models/features/marker/marker-options.d.ts +11 -0
- package/lib/models/features/marker/marker-options.js +18 -0
- package/lib/models/features/marker/marker-options.js.map +1 -0
- package/lib/models/features/marker-clusterer/marker-clusterer-config.d.ts +6 -0
- package/lib/models/features/marker-clusterer/marker-clusterer-config.js +10 -0
- package/lib/models/features/marker-clusterer/marker-clusterer-config.js.map +1 -0
- package/lib/models/features/overlay/overlay-options.d.ts +11 -0
- package/lib/models/features/overlay/overlay-options.js +15 -0
- package/lib/models/features/overlay/overlay-options.js.map +1 -0
- package/lib/models/features/polygons/polygon-alter-options.d.ts +13 -0
- package/lib/models/features/polygons/polygon-alter-options.js +14 -0
- package/lib/models/features/polygons/polygon-alter-options.js.map +1 -0
- package/lib/models/features/polygons/polygon-options.d.ts +15 -0
- package/lib/models/features/polygons/polygon-options.js +19 -0
- package/lib/models/features/polygons/polygon-options.js.map +1 -0
- package/lib/models/features/polyline/navigations-options.d.ts +11 -0
- package/lib/models/features/polyline/navigations-options.js +16 -0
- package/lib/models/features/polyline/navigations-options.js.map +1 -0
- package/lib/models/features/polyline/polyline-options.d.ts +18 -0
- package/lib/models/features/polyline/polyline-options.js +20 -0
- package/lib/models/features/polyline/polyline-options.js.map +1 -0
- package/lib/models/features/popup/popup-options.d.ts +9 -0
- package/lib/models/features/popup/popup-options.js +13 -0
- package/lib/models/features/popup/popup-options.js.map +1 -0
- package/lib/utils/maps-api-loader.service.d.ts +14 -0
- package/lib/utils/maps-api-loader.service.js +89 -0
- package/lib/utils/maps-api-loader.service.js.map +1 -0
- package/lib/utils/url-builder.d.ts +20 -0
- package/lib/utils/url-builder.js +44 -0
- package/lib/utils/url-builder.js.map +1 -0
- package/lib-esm/index.d.ts +46 -0
- package/lib-esm/index.js +47 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/map.d.ts +519 -0
- package/lib-esm/map.js +1137 -0
- package/lib-esm/map.js.map +1 -0
- package/lib-esm/models/apis/google/google-circles.d.ts +18 -0
- package/lib-esm/models/apis/google/google-circles.js +134 -0
- package/lib-esm/models/apis/google/google-circles.js.map +1 -0
- package/lib-esm/models/apis/google/google-geojson.d.ts +9 -0
- package/lib-esm/models/apis/google/google-geojson.js +73 -0
- package/lib-esm/models/apis/google/google-geojson.js.map +1 -0
- package/lib-esm/models/apis/google/google-map.d.ts +16 -0
- package/lib-esm/models/apis/google/google-map.js +174 -0
- package/lib-esm/models/apis/google/google-map.js.map +1 -0
- package/lib-esm/models/apis/google/google-markers.d.ts +29 -0
- package/lib-esm/models/apis/google/google-markers.js +325 -0
- package/lib-esm/models/apis/google/google-markers.js.map +1 -0
- package/lib-esm/models/apis/google/google-overlay.d.ts +11 -0
- package/lib-esm/models/apis/google/google-overlay.js +102 -0
- package/lib-esm/models/apis/google/google-overlay.js.map +1 -0
- package/lib-esm/models/apis/google/google-polygons.d.ts +29 -0
- package/lib-esm/models/apis/google/google-polygons.js +301 -0
- package/lib-esm/models/apis/google/google-polygons.js.map +1 -0
- package/lib-esm/models/apis/google/google-polylines.d.ts +55 -0
- package/lib-esm/models/apis/google/google-polylines.js +707 -0
- package/lib-esm/models/apis/google/google-polylines.js.map +1 -0
- package/lib-esm/models/apis/google/google-popup.d.ts +10 -0
- package/lib-esm/models/apis/google/google-popup.js +59 -0
- package/lib-esm/models/apis/google/google-popup.js.map +1 -0
- package/lib-esm/models/apis/googleMaps.d.ts +97 -0
- package/lib-esm/models/apis/googleMaps.js +449 -0
- package/lib-esm/models/apis/googleMaps.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-circle.d.ts +18 -0
- package/lib-esm/models/apis/leaflet/leaflet-circle.js +163 -0
- package/lib-esm/models/apis/leaflet/leaflet-circle.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-geojson.d.ts +9 -0
- package/lib-esm/models/apis/leaflet/leaflet-geojson.js +73 -0
- package/lib-esm/models/apis/leaflet/leaflet-geojson.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-map.d.ts +16 -0
- package/lib-esm/models/apis/leaflet/leaflet-map.js +140 -0
- package/lib-esm/models/apis/leaflet/leaflet-map.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-markers.d.ts +29 -0
- package/lib-esm/models/apis/leaflet/leaflet-markers.js +294 -0
- package/lib-esm/models/apis/leaflet/leaflet-markers.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-overlay.d.ts +10 -0
- package/lib-esm/models/apis/leaflet/leaflet-overlay.js +35 -0
- package/lib-esm/models/apis/leaflet/leaflet-overlay.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-polygons.d.ts +23 -0
- package/lib-esm/models/apis/leaflet/leaflet-polygons.js +211 -0
- package/lib-esm/models/apis/leaflet/leaflet-polygons.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-polylines.d.ts +55 -0
- package/lib-esm/models/apis/leaflet/leaflet-polylines.js +721 -0
- package/lib-esm/models/apis/leaflet/leaflet-polylines.js.map +1 -0
- package/lib-esm/models/apis/leaflet/leaflet-popup.d.ts +11 -0
- package/lib-esm/models/apis/leaflet/leaflet-popup.js +74 -0
- package/lib-esm/models/apis/leaflet/leaflet-popup.js.map +1 -0
- package/lib-esm/models/apis/leaflet.d.ts +99 -0
- package/lib-esm/models/apis/leaflet.js +464 -0
- package/lib-esm/models/apis/leaflet.js.map +1 -0
- package/lib-esm/models/apis/mapFunctions.d.ts +85 -0
- package/lib-esm/models/apis/mapFunctions.js +2 -0
- package/lib-esm/models/apis/mapFunctions.js.map +1 -0
- package/lib-esm/models/dto/event-type.d.ts +33 -0
- package/lib-esm/models/dto/event-type.js +39 -0
- package/lib-esm/models/dto/event-type.js.map +1 -0
- package/lib-esm/models/dto/map-type.d.ts +4 -0
- package/lib-esm/models/dto/map-type.js +6 -0
- package/lib-esm/models/dto/map-type.js.map +1 -0
- package/lib-esm/models/dto/polyline-type.d.ts +5 -0
- package/lib-esm/models/dto/polyline-type.js +7 -0
- package/lib-esm/models/dto/polyline-type.js.map +1 -0
- package/lib-esm/models/features/circle/circle-alter-options.d.ts +12 -0
- package/lib-esm/models/features/circle/circle-alter-options.js +14 -0
- package/lib-esm/models/features/circle/circle-alter-options.js.map +1 -0
- package/lib-esm/models/features/circle/circle-options.d.ts +15 -0
- package/{src → lib-esm/models/features}/circle/circle-options.js +6 -4
- package/lib-esm/models/features/circle/circle-options.js.map +1 -0
- package/lib-esm/models/features/events/event-return.d.ts +4 -0
- package/lib-esm/models/features/events/event-return.js +8 -0
- package/lib-esm/models/features/events/event-return.js.map +1 -0
- package/lib-esm/models/features/geojson/geojson-options.d.ts +5 -0
- package/lib-esm/models/features/geojson/geojson-options.js +9 -0
- package/lib-esm/models/features/geojson/geojson-options.js.map +1 -0
- package/lib-esm/models/features/marker/circle-marker-options.d.ts +9 -0
- package/lib-esm/models/features/marker/circle-marker-options.js +12 -0
- package/lib-esm/models/features/marker/circle-marker-options.js.map +1 -0
- package/lib-esm/models/features/marker/circle-marker-style.d.ts +8 -0
- package/lib-esm/models/features/marker/circle-marker-style.js +12 -0
- package/lib-esm/models/features/marker/circle-marker-style.js.map +1 -0
- package/lib-esm/models/features/marker/marker-alter-options.d.ts +8 -0
- package/lib-esm/models/features/marker/marker-alter-options.js +10 -0
- package/lib-esm/models/features/marker/marker-alter-options.js.map +1 -0
- package/lib-esm/models/features/marker/marker-icon.d.ts +6 -0
- package/lib-esm/models/features/marker/marker-icon.js +10 -0
- package/lib-esm/models/features/marker/marker-icon.js.map +1 -0
- package/lib-esm/models/features/marker/marker-options.d.ts +11 -0
- package/lib-esm/models/features/marker/marker-options.js +18 -0
- package/lib-esm/models/features/marker/marker-options.js.map +1 -0
- package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.d.ts +6 -0
- package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.js +10 -0
- package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.js.map +1 -0
- package/lib-esm/models/features/overlay/overlay-options.d.ts +11 -0
- package/lib-esm/models/features/overlay/overlay-options.js +15 -0
- package/lib-esm/models/features/overlay/overlay-options.js.map +1 -0
- package/lib-esm/models/features/polygons/polygon-alter-options.d.ts +13 -0
- package/lib-esm/models/features/polygons/polygon-alter-options.js +14 -0
- package/lib-esm/models/features/polygons/polygon-alter-options.js.map +1 -0
- package/lib-esm/models/features/polygons/polygon-options.d.ts +15 -0
- package/{src → lib-esm/models/features}/polygons/polygon-options.js +7 -5
- package/lib-esm/models/features/polygons/polygon-options.js.map +1 -0
- package/lib-esm/models/features/polyline/navigations-options.d.ts +11 -0
- package/lib-esm/models/features/polyline/navigations-options.js +16 -0
- package/lib-esm/models/features/polyline/navigations-options.js.map +1 -0
- package/lib-esm/models/features/polyline/polyline-options.d.ts +18 -0
- package/lib-esm/models/features/polyline/polyline-options.js +20 -0
- package/lib-esm/models/features/polyline/polyline-options.js.map +1 -0
- package/lib-esm/models/features/popup/popup-options.d.ts +9 -0
- package/lib-esm/models/features/popup/popup-options.js +13 -0
- package/lib-esm/models/features/popup/popup-options.js.map +1 -0
- package/lib-esm/utils/maps-api-loader.service.d.ts +14 -0
- package/lib-esm/utils/maps-api-loader.service.js +89 -0
- package/lib-esm/utils/maps-api-loader.service.js.map +1 -0
- package/lib-esm/utils/url-builder.d.ts +20 -0
- package/lib-esm/utils/url-builder.js +44 -0
- package/lib-esm/utils/url-builder.js.map +1 -0
- package/package.json +69 -53
- package/test/test.js +11 -0
- package/tslint.json +24 -0
- package/typings.json +5 -0
- package/.babelrc +0 -4
- package/.editorconfig +0 -12
- package/.eslintrc +0 -291
- package/.nvmrc +0 -1
- package/.travis.yml +0 -5
- package/demo/demo.js +0 -432
- package/demo/images/cursor_locate.png +0 -0
- package/demo/images/inicio_rota.png +0 -0
- package/demo/index.html +0 -58
- package/demo/style.css +0 -45
- package/lib/inlogMaps.js +0 -16326
- package/lib/inlogMaps.js.map +0 -1
- package/lib/inlogMaps.min.js +0 -5
- package/src/circle/circle-alter-options.js +0 -9
- package/src/events/event-return.js +0 -5
- package/src/google-maps.js +0 -722
- package/src/index.js +0 -36
- package/src/leaflet.js +0 -638
- package/src/map.js +0 -306
- package/src/marker/circle-marker-options.js +0 -9
- package/src/marker/circle-marker-style.js +0 -9
- package/src/marker/marker-alter-options.js +0 -7
- package/src/marker/marker-icon.js +0 -6
- package/src/marker/marker-options.js +0 -10
- package/src/polygons/polygon-alter-options.js +0 -9
- package/src/polyline/navigations-options.js +0 -6
- package/src/polyline/polyline-alter-options.js +0 -9
- package/src/polyline/polyline-navigation-options.js +0 -15
- package/src/polyline/polyline-options.js +0 -12
- package/src/popup/popup-options.js +0 -7
- package/test/index.spec.js +0 -32
- package/webpack.config.js +0 -50
- package/yarn.lock +0 -3403
package/src/map.js
DELETED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import GoogleMaps from './google-maps';
|
|
2
|
-
import Leaflet from './leaflet';
|
|
3
|
-
|
|
4
|
-
export default class Map {
|
|
5
|
-
constructor(mapType) {
|
|
6
|
-
this.map = mapType === 'Google' ? new GoogleMaps() : new Leaflet();
|
|
7
|
-
|
|
8
|
-
// generic lists
|
|
9
|
-
this._markersList = {};
|
|
10
|
-
this._polygonsList = {};
|
|
11
|
-
this._circlesList = {};
|
|
12
|
-
this._polylinesList = {};
|
|
13
|
-
this._infoWindowList = {};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* GEOJson */
|
|
17
|
-
/**
|
|
18
|
-
* Use this function to add GEOJSON to the map
|
|
19
|
-
* @param {string} data
|
|
20
|
-
* @param {*} options are the created object's parameters
|
|
21
|
-
* {
|
|
22
|
-
* editable: boolean,
|
|
23
|
-
* draggable: boolean
|
|
24
|
-
* }
|
|
25
|
-
* @param {function} eventClick is a function callback to the action on click
|
|
26
|
-
*/
|
|
27
|
-
loadGEOJson(data, options, eventClick) {
|
|
28
|
-
let self = this;
|
|
29
|
-
|
|
30
|
-
self.map._loadGEOJson(data, options, eventClick);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Markers */
|
|
34
|
-
/**
|
|
35
|
-
* Use this function to draw markers in the map
|
|
36
|
-
* @param {tring} type is the type of the marker to help you find it later
|
|
37
|
-
* @param {inlogMaps.MarkerOptions} options are the parameters of the marker
|
|
38
|
-
* @param {function} eventClick is a function callback to the action on click
|
|
39
|
-
*/
|
|
40
|
-
drawMarker(type, options, eventClick) {
|
|
41
|
-
let self = this;
|
|
42
|
-
let marker = self.map._drawMarker(options, eventClick);
|
|
43
|
-
|
|
44
|
-
if (!self._markersList[type]) {
|
|
45
|
-
self._markersList[type] = [];
|
|
46
|
-
}
|
|
47
|
-
marker.type = 'simple';
|
|
48
|
-
self._markersList[type].push(marker);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Use this function to draw circle markers in the map
|
|
53
|
-
* @param {string} type is the type of the marker to help you find it later
|
|
54
|
-
* @param {inlogMaps.CircleMarkerOptions} options are the parameters of the circle marker
|
|
55
|
-
* @param {function} eventClick is a function callback to the action on click
|
|
56
|
-
*/
|
|
57
|
-
drawCircleMarker(type, options, eventClick) {
|
|
58
|
-
let self = this;
|
|
59
|
-
let marker = self.map._drawCircleMarker(options, eventClick);
|
|
60
|
-
|
|
61
|
-
if (!self._markersList[type]) {
|
|
62
|
-
self._markersList[type] = [];
|
|
63
|
-
}
|
|
64
|
-
marker.type = 'circle';
|
|
65
|
-
self._markersList[type].push(marker);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Use this function to show/hide markers from a especific type
|
|
70
|
-
* @param {boolean} show
|
|
71
|
-
* @param {string} type is the type of the marker you created
|
|
72
|
-
*/
|
|
73
|
-
showMarkers(show, type) {
|
|
74
|
-
let self = this;
|
|
75
|
-
let markers = self._markersList[type];
|
|
76
|
-
|
|
77
|
-
if (markers) {
|
|
78
|
-
self.map._showMarkers(markers, show);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Use this function to alter marker style
|
|
84
|
-
* @param {string} type is the type of the marker to help you find it later
|
|
85
|
-
* @param {inlogMaps.MarkerAlterOptions} options are the style parameters of the marker
|
|
86
|
-
*/
|
|
87
|
-
alterMarkerOptions(type, options) {
|
|
88
|
-
let self = this;
|
|
89
|
-
let markers = self._markersList[type];
|
|
90
|
-
|
|
91
|
-
if (markers) {
|
|
92
|
-
self.map._alterMarkerOptions(markers, options);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/* Polygons */
|
|
97
|
-
/**
|
|
98
|
-
* Use this function to draw polygons
|
|
99
|
-
* @param {string} type is the type of the polygon to help you find it later
|
|
100
|
-
* @param {inlogMaps.PolygonOptions} options are the parameters of the polygon
|
|
101
|
-
* @param {function} eventClick
|
|
102
|
-
*/
|
|
103
|
-
drawPolygon(type, options, eventClick) {
|
|
104
|
-
let self = this;
|
|
105
|
-
let polygon = self.map._drawPolygon(options, eventClick);
|
|
106
|
-
|
|
107
|
-
if (!self._polygonsList[type]) {
|
|
108
|
-
self._polygonsList[type] = [];
|
|
109
|
-
}
|
|
110
|
-
self._polygonsList[type].push(polygon);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Use this function to show/hide polygon from a especific type
|
|
115
|
-
* @param {boolean} show
|
|
116
|
-
* @param {string} type
|
|
117
|
-
*/
|
|
118
|
-
showPolygons(show, type) {
|
|
119
|
-
let self = this;
|
|
120
|
-
let polygons = self._polygonsList[type];
|
|
121
|
-
|
|
122
|
-
if (polygons) {
|
|
123
|
-
self.map._showPolygons(polygons, show);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Use this function to alter polygons options/style
|
|
129
|
-
* @param {string} type is the type of the polygon to help you find it later
|
|
130
|
-
* @param {inlogMaps.PolygonAlterOptions} options are the parameters of the polygon
|
|
131
|
-
*/
|
|
132
|
-
alterPolygonOptions(type, options) {
|
|
133
|
-
let self = this;
|
|
134
|
-
let polygons = self._polygonsList[type];
|
|
135
|
-
|
|
136
|
-
if (polygons) {
|
|
137
|
-
self.map._alterPolygonOptions(polygons, options);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/* Polylines */
|
|
142
|
-
/**
|
|
143
|
-
* Use this function to draw polylines on the map
|
|
144
|
-
* @param {string} type
|
|
145
|
-
* @param {inlogMaps.PolylineOptions} options
|
|
146
|
-
* @param {function} eventClick
|
|
147
|
-
*/
|
|
148
|
-
drawPolyline(type, options, eventClick) {
|
|
149
|
-
let self = this;
|
|
150
|
-
let polyline = self.map._drawPolyline(options, eventClick);
|
|
151
|
-
|
|
152
|
-
self._polylinesList[type] = polyline;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Use this function to draw polylines with navigation on the map
|
|
157
|
-
* @param {string} type
|
|
158
|
-
* @param {inlogMaps.PolylineNavigationOptions} options
|
|
159
|
-
*/
|
|
160
|
-
drawPolylineWithNavigation(type, options) {
|
|
161
|
-
let self = this;
|
|
162
|
-
let polyline = self.map._drawPolylineWithNavigation(options);
|
|
163
|
-
|
|
164
|
-
self._polylinesList[type] = polyline;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Use this function to add more paths to a polyline
|
|
169
|
-
* @param {string} type
|
|
170
|
-
* @param {Array} position
|
|
171
|
-
*/
|
|
172
|
-
addPolylinePath(type, position) {
|
|
173
|
-
let self = this;
|
|
174
|
-
|
|
175
|
-
if (!self._polylinesList[type]) {
|
|
176
|
-
self.drawPolyline(type, {
|
|
177
|
-
addToMap: true
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
let polyline = self._polylinesList[type];
|
|
181
|
-
|
|
182
|
-
if (polyline) {
|
|
183
|
-
self.map._addPolylinePath(polyline, position);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Use this function to clear polyline selected from the map
|
|
189
|
-
*/
|
|
190
|
-
removePolylineHighlight() {
|
|
191
|
-
let self = this;
|
|
192
|
-
|
|
193
|
-
self.map._removePolylineHighlight();
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Use this function to show/hide polylines
|
|
198
|
-
* @param {boolean} show
|
|
199
|
-
* @param {string} type
|
|
200
|
-
*/
|
|
201
|
-
showPolyline(show, type) {
|
|
202
|
-
let self = this;
|
|
203
|
-
let polyline = self._polylinesList[type];
|
|
204
|
-
|
|
205
|
-
if (polyline) {
|
|
206
|
-
self.map._showPolyline(polyline, show);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Use this function to alter polyline options
|
|
212
|
-
* @param {string} type
|
|
213
|
-
* @param {inlogMaps.PolylineAlterOptions} options
|
|
214
|
-
*/
|
|
215
|
-
alterPolylineOptions(type, options) {
|
|
216
|
-
let self = this;
|
|
217
|
-
let polyline = self._polylinesList[type];
|
|
218
|
-
|
|
219
|
-
if (polyline) {
|
|
220
|
-
self.map._alterPolylineOptions(polyline, options);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
/* Circles */
|
|
225
|
-
/**
|
|
226
|
-
* Use this function to draw circles on the map
|
|
227
|
-
* @param {string} type
|
|
228
|
-
* @param {inlogMaps.CircleOptions} options
|
|
229
|
-
* @param {function} eventClick
|
|
230
|
-
*/
|
|
231
|
-
drawCircle(type, options, eventClick) {
|
|
232
|
-
let self = this;
|
|
233
|
-
let circle = self.map._drawCircle(options, eventClick);
|
|
234
|
-
|
|
235
|
-
if (!self._circlesList[type]) {
|
|
236
|
-
self._circlesList[type] = [];
|
|
237
|
-
}
|
|
238
|
-
self._circlesList[type].push(circle);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Use this function to show/hide circles from a especific type
|
|
243
|
-
* @param {boolean} show
|
|
244
|
-
* @param {string} type
|
|
245
|
-
*/
|
|
246
|
-
showCircles(show, type) {
|
|
247
|
-
let self = this;
|
|
248
|
-
let circles = self._circlesList[type];
|
|
249
|
-
|
|
250
|
-
if (circles) {
|
|
251
|
-
self.map._showCircles(circles, show);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Use this function to alter circle options
|
|
257
|
-
* @param {string} type
|
|
258
|
-
* @param {inlogMaps.CircleAlterOptions} options
|
|
259
|
-
*/
|
|
260
|
-
alterCircleOptions(type, options) {
|
|
261
|
-
let self = this;
|
|
262
|
-
let circles = self._circlesList[type];
|
|
263
|
-
|
|
264
|
-
if (circles) {
|
|
265
|
-
self.map._alterCircleOptions(circles, options);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/* Info Windows */
|
|
270
|
-
/**
|
|
271
|
-
* Use this function to draw popups on the map
|
|
272
|
-
* @param {string} type
|
|
273
|
-
* @param {inlogMaps.PopupOptions} options
|
|
274
|
-
*/
|
|
275
|
-
drawPopup(type, options) {
|
|
276
|
-
let self = this;
|
|
277
|
-
|
|
278
|
-
if (self._infoWindowList[type]) {
|
|
279
|
-
self.map._alterPopup(self._infoWindowList[type], options);
|
|
280
|
-
} else {
|
|
281
|
-
let infoWindow = self.map._drawPopup(options);
|
|
282
|
-
|
|
283
|
-
self._infoWindowList[type] = infoWindow;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/* Map */
|
|
288
|
-
/**
|
|
289
|
-
* Use this function to add event clicks on the map
|
|
290
|
-
* @param {function} eventClick
|
|
291
|
-
*/
|
|
292
|
-
addClickMap(eventClick) {
|
|
293
|
-
let self = this;
|
|
294
|
-
|
|
295
|
-
self.map._addClickMap(eventClick);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Use this function to remove event clicks from the map
|
|
300
|
-
*/
|
|
301
|
-
removeClickMap() {
|
|
302
|
-
let self = this;
|
|
303
|
-
|
|
304
|
-
self.map._removeClickMap();
|
|
305
|
-
}
|
|
306
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default class MarkerOptions {
|
|
2
|
-
constructor(latlng, addToMap, draggable, icon, fitBounds, object) {
|
|
3
|
-
this.latlng = latlng;
|
|
4
|
-
this.addToMap = addToMap;
|
|
5
|
-
this.draggable = draggable;
|
|
6
|
-
this.icon = icon;
|
|
7
|
-
this.fitBounds = fitBounds;
|
|
8
|
-
this.object = object;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default class PolylineNavigationOptions {
|
|
2
|
-
constructor(path, infowindows, addToMap, fitBounds, editable, draggable, color, weight, object,
|
|
3
|
-
navigateOptions) {
|
|
4
|
-
this.path = path;
|
|
5
|
-
this.infowindows = infowindows;
|
|
6
|
-
this.addToMap = addToMap;
|
|
7
|
-
this.fitBounds = fitBounds;
|
|
8
|
-
this.editable = editable;
|
|
9
|
-
this.draggable = draggable;
|
|
10
|
-
this.color = color;
|
|
11
|
-
this.weight = weight;
|
|
12
|
-
this.object = object;
|
|
13
|
-
this.navigateOptions = navigateOptions;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default class PolylineOptions {
|
|
2
|
-
constructor(path, addToMap, fitBounds, editable, draggable, color, weight, object) {
|
|
3
|
-
this.path = path;
|
|
4
|
-
this.addToMap = addToMap;
|
|
5
|
-
this.fitBounds = fitBounds;
|
|
6
|
-
this.editable = editable;
|
|
7
|
-
this.draggable = draggable;
|
|
8
|
-
this.color = color;
|
|
9
|
-
this.weight = weight;
|
|
10
|
-
this.object = object;
|
|
11
|
-
}
|
|
12
|
-
}
|
package/test/index.spec.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* global describe, it, before */
|
|
2
|
-
|
|
3
|
-
import chai from 'chai';
|
|
4
|
-
//import {Cat, Dog} from '../lib/webpack-library-starter.js';
|
|
5
|
-
|
|
6
|
-
chai.expect();
|
|
7
|
-
|
|
8
|
-
const expect = chai.expect;
|
|
9
|
-
|
|
10
|
-
let lib;
|
|
11
|
-
|
|
12
|
-
/*describe('Given an instance of my Cat library', () => {
|
|
13
|
-
before(() => {
|
|
14
|
-
lib = new Cat();
|
|
15
|
-
});
|
|
16
|
-
describe('when I need the name', () => {
|
|
17
|
-
it('should return the name', () => {
|
|
18
|
-
expect(lib.name).to.be.equal('Cat');
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('Given an instance of my Dog library', () => {
|
|
24
|
-
before(() => {
|
|
25
|
-
lib = new Dog();
|
|
26
|
-
});
|
|
27
|
-
describe('when I need the name', () => {
|
|
28
|
-
it('should return the name', () => {
|
|
29
|
-
expect(lib.name).to.be.equal('Dog');
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
});*/
|
package/webpack.config.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/* global __dirname, require, module*/
|
|
2
|
-
|
|
3
|
-
const webpack = require('webpack');
|
|
4
|
-
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const env = require('yargs').argv.env; // use --env with webpack 2
|
|
7
|
-
|
|
8
|
-
let libraryName = 'inlogMaps';
|
|
9
|
-
|
|
10
|
-
let plugins = [], outputFile;
|
|
11
|
-
|
|
12
|
-
if (env === 'build') {
|
|
13
|
-
plugins.push(new UglifyJsPlugin({minimize: true}));
|
|
14
|
-
outputFile = libraryName + '.min.js';
|
|
15
|
-
} else {
|
|
16
|
-
outputFile = libraryName + '.js';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const config = {
|
|
20
|
-
entry: __dirname + '/src/index.js',
|
|
21
|
-
devtool: 'source-map',
|
|
22
|
-
output: {
|
|
23
|
-
path: __dirname + '/lib',
|
|
24
|
-
filename: outputFile,
|
|
25
|
-
library: libraryName,
|
|
26
|
-
libraryTarget: 'umd',
|
|
27
|
-
umdNamedDefine: true
|
|
28
|
-
},
|
|
29
|
-
module: {
|
|
30
|
-
rules: [
|
|
31
|
-
{
|
|
32
|
-
test: /(\.jsx|\.js)$/,
|
|
33
|
-
loader: 'babel-loader',
|
|
34
|
-
exclude: /(node_modules|bower_components)/
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
test: /(\.jsx|\.js)$/,
|
|
38
|
-
loader: 'eslint-loader',
|
|
39
|
-
exclude: /node_modules/
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
resolve: {
|
|
44
|
-
modules: [path.resolve('./node_modules'), path.resolve('./src')],
|
|
45
|
-
extensions: ['.json', '.js']
|
|
46
|
-
},
|
|
47
|
-
plugins: plugins
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
module.exports = config;
|