mapping-component-package-jp 0.0.46 → 0.0.48
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
CHANGED
|
@@ -63,6 +63,11 @@ export class MapOverlayManager {
|
|
|
63
63
|
NDVI_RemoveOverlay(): void;
|
|
64
64
|
NDVI_DrawLocation(locationJson: any[], offsetX: number, offsetY: number, vMapWidth: number, showTooltip: boolean): void;
|
|
65
65
|
|
|
66
|
+
//Other tiles
|
|
67
|
+
NLC_AddOverlay(tileURL: string): void;
|
|
68
|
+
NLC_RemoveOverlay(): void;
|
|
69
|
+
|
|
70
|
+
|
|
66
71
|
// Cleanup Methods
|
|
67
72
|
destroy(): void;
|
|
68
73
|
map_clear(): void;
|
|
@@ -2934,7 +2934,9 @@ export class MapOverlayManager {
|
|
|
2934
2934
|
var path = [];
|
|
2935
2935
|
sp.forEach(function(c) {
|
|
2936
2936
|
path.push(new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1])));
|
|
2937
|
-
|
|
2937
|
+
if(fitBounds) {
|
|
2938
|
+
bounds.extend(new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1])));
|
|
2939
|
+
}
|
|
2938
2940
|
});
|
|
2939
2941
|
paths.push(path);
|
|
2940
2942
|
});
|
|
@@ -3035,7 +3037,7 @@ export class MapOverlayManager {
|
|
|
3035
3037
|
paths = [];
|
|
3036
3038
|
var spolies = location.poly.split(',');
|
|
3037
3039
|
spolies.forEach(function(poly) {
|
|
3038
|
-
dp = google.maps.geometry.encoding.decodePath(
|
|
3040
|
+
dp = google.maps.geometry.encoding.decodePath(poly, 5);
|
|
3039
3041
|
paths.push(dp);
|
|
3040
3042
|
});
|
|
3041
3043
|
|
|
@@ -3722,5 +3724,67 @@ export class MapOverlayManager {
|
|
|
3722
3724
|
});
|
|
3723
3725
|
mapListeners.push(zoomChangedListener);
|
|
3724
3726
|
}
|
|
3727
|
+
|
|
3728
|
+
|
|
3729
|
+
_this.NLC_AddOverlay = function (tileURL) {
|
|
3730
|
+
|
|
3731
|
+
|
|
3732
|
+
if (map.getZoom() > 14) {
|
|
3733
|
+
|
|
3734
|
+
//console.log('zoom > 14');
|
|
3735
|
+
|
|
3736
|
+
var zoomOnAddOverlayChangedListener = google.maps.event.addListenerOnce(map, 'zoom_changed', function () {
|
|
3737
|
+
var vdiMapType = new google.maps.ImageMapType({
|
|
3738
|
+
getTileUrl: function (coord, zoom) {
|
|
3739
|
+
return [tileURL.replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join('');
|
|
3740
|
+
},
|
|
3741
|
+
tileSize: new google.maps.Size(256, 256),
|
|
3742
|
+
minZoom: 5,
|
|
3743
|
+
maxZoom: 14
|
|
3744
|
+
});
|
|
3745
|
+
map.overlayMapTypes.push(vdiMapType);
|
|
3746
|
+
});
|
|
3747
|
+
mapListeners.push(zoomOnAddOverlayChangedListener);
|
|
3748
|
+
|
|
3749
|
+
map.setZoom(14);
|
|
3750
|
+
|
|
3751
|
+
} else if (map.getZoom() < 5) {
|
|
3752
|
+
|
|
3753
|
+
//console.log('zoom < 5');
|
|
3754
|
+
|
|
3755
|
+
var zoomOnAddOverlayChangedListener = google.maps.event.addListenerOnce(map, 'zoom_changed', function () {
|
|
3756
|
+
var vdiMapType = new google.maps.ImageMapType({
|
|
3757
|
+
getTileUrl: function (coord, zoom) {
|
|
3758
|
+
return [tileURL.replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join('');
|
|
3759
|
+
},
|
|
3760
|
+
tileSize: new google.maps.Size(256, 256),
|
|
3761
|
+
minZoom: 5,
|
|
3762
|
+
maxZoom: 14
|
|
3763
|
+
});
|
|
3764
|
+
map.overlayMapTypes.push(vdiMapType);
|
|
3765
|
+
});
|
|
3766
|
+
mapListeners.push(zoomOnAddOverlayChangedListener);
|
|
3767
|
+
|
|
3768
|
+
map.setZoom(5);
|
|
3769
|
+
|
|
3770
|
+
} else {
|
|
3771
|
+
|
|
3772
|
+
var vdiMapType = new google.maps.ImageMapType({
|
|
3773
|
+
getTileUrl: function (coord, zoom) {
|
|
3774
|
+
return [tileURL.replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join('');
|
|
3775
|
+
},
|
|
3776
|
+
tileSize: new google.maps.Size(256, 256),
|
|
3777
|
+
minZoom: 5,
|
|
3778
|
+
maxZoom: 14
|
|
3779
|
+
});
|
|
3780
|
+
map.overlayMapTypes.push(vdiMapType);
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
_this.NLC_RemoveOverlay = function () {
|
|
3785
|
+
map.overlayMapTypes.clear();
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
|
|
3725
3789
|
}
|
|
3726
3790
|
}
|