mapping-component-package-jp 0.0.42 → 0.0.44
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/dist/index.d.ts +4 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/js/mapEncapsulation/mapOverlayManager.d.ts +4 -2
- package/src/js/mapEncapsulation/mapOverlayManager.js +94 -20
package/package.json
CHANGED
|
@@ -19,11 +19,13 @@ export class MapOverlayManager {
|
|
|
19
19
|
// Rendering Methods
|
|
20
20
|
RenderFields(locations: any[], properties: any, editMode?: boolean): void;
|
|
21
21
|
RenderRegionFarms(locationsJson: any, icon: any, fitBounds: boolean): void;
|
|
22
|
-
RenderRegions(regionLocations: any[], properties: any, farmLocations: any[], icon: any): void;
|
|
22
|
+
RenderRegions(regionLocations: any[], properties: any, farmLocations: any[], icon: any, offsetX: number, offsetY: number): void;
|
|
23
23
|
RenderBackgroundFields(locations: any[], properties: any): void;
|
|
24
24
|
RenderSAAdministrative(saAdministrativeJson: any[], selectedSAProvince: number, selectedSADM: number, selectedSALM: number, selectedSAWard: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean): void;
|
|
25
25
|
RenderSACadastral(saCadastralJson: any, offsetX: number, offsetY: number, vmWidth: number, isDashboard: boolean, fitBounds: boolean): void;
|
|
26
|
-
|
|
26
|
+
RenderGSGPRegions(gpRegionsJson: any[], gsByRegionJson: any[], selectedRegion: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean): void;
|
|
27
|
+
RenderGSProvinces(provincesJson: any[], gsByProvinceJson: any[], selectedProvince: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean): void;
|
|
28
|
+
|
|
27
29
|
// Shape Selection and Management
|
|
28
30
|
selectShape(shapeId: string | number, selectedStyle: any, unselectedStyle: any): void;
|
|
29
31
|
isShapeInLocPolygons(shapeId: string | number): boolean;
|
|
@@ -2117,7 +2117,7 @@ export class MapOverlayManager {
|
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
2119
|
|
|
2120
|
-
_this.RenderRegions = function (regionLocations, properties, farmLocations, icon) {
|
|
2120
|
+
_this.RenderRegions = function (regionLocations, properties, farmLocations, icon, offsetX, offsetY) {
|
|
2121
2121
|
var polygon = null;
|
|
2122
2122
|
var polyPath = null;
|
|
2123
2123
|
var path = null;
|
|
@@ -2175,17 +2175,12 @@ export class MapOverlayManager {
|
|
|
2175
2175
|
fpolies.push(polygon);
|
|
2176
2176
|
}
|
|
2177
2177
|
});
|
|
2178
|
-
|
|
2178
|
+
|
|
2179
2179
|
var rboundsChangedListener = google.maps.event.addListenerOnce(map, "bounds_changed", function() {
|
|
2180
|
-
|
|
2181
|
-
type: 'SUCCESS',
|
|
2182
|
-
message: 'Region bounds changed',
|
|
2183
|
-
code: 200,
|
|
2184
|
-
data: null
|
|
2185
|
-
});
|
|
2180
|
+
offsetCenter(map.getCenter(), offsetX, offsetY);
|
|
2186
2181
|
});
|
|
2187
2182
|
mapListeners.push(rboundsChangedListener);
|
|
2188
|
-
|
|
2183
|
+
|
|
2189
2184
|
map.fitBounds(rbounds);
|
|
2190
2185
|
regions_BindPolyEvents(farmLocations, icon);
|
|
2191
2186
|
}
|
|
@@ -2398,8 +2393,8 @@ export class MapOverlayManager {
|
|
|
2398
2393
|
}
|
|
2399
2394
|
|
|
2400
2395
|
function Display_SAAdministrative(saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vmWidth, isDashboard) {
|
|
2401
|
-
console.log('Display_SAAdministrative');
|
|
2402
|
-
console.log(saAdministrativeJson);
|
|
2396
|
+
//console.log('Display_SAAdministrative');
|
|
2397
|
+
//console.log(saAdministrativeJson);
|
|
2403
2398
|
|
|
2404
2399
|
var locations = saAdministrativeJson;
|
|
2405
2400
|
|
|
@@ -2845,7 +2840,41 @@ export class MapOverlayManager {
|
|
|
2845
2840
|
});
|
|
2846
2841
|
}
|
|
2847
2842
|
|
|
2848
|
-
function
|
|
2843
|
+
function Display_DrawGSProvinces(locationsJson, selectedProvince, offsetX, offsetY) {
|
|
2844
|
+
var polygon = null;
|
|
2845
|
+
var locations = locationsJson;
|
|
2846
|
+
var dp, paths;
|
|
2847
|
+
|
|
2848
|
+
locations.forEach(function (location) {
|
|
2849
|
+
if(location.id == selectedProvince || selectedProvince === 0) {
|
|
2850
|
+
if (location && location.poly && location.poly.length > 0) {
|
|
2851
|
+
|
|
2852
|
+
paths = [];
|
|
2853
|
+
var spolies = location.poly.split(',');
|
|
2854
|
+
spolies.forEach(function(poly) {
|
|
2855
|
+
dp = google.maps.geometry.encoding.decodePath(location.poly, 5);
|
|
2856
|
+
paths.push(dp);
|
|
2857
|
+
});
|
|
2858
|
+
|
|
2859
|
+
polygon = new google.maps.Polygon({
|
|
2860
|
+
map: map,
|
|
2861
|
+
paths: paths,
|
|
2862
|
+
strokeColor: '#000000',
|
|
2863
|
+
strokeOpacity: 1,
|
|
2864
|
+
strokeWeight: 3,
|
|
2865
|
+
fillColor: '#000000',
|
|
2866
|
+
fillOpacity: 0.3,
|
|
2867
|
+
id: location.id,
|
|
2868
|
+
content: location.name,
|
|
2869
|
+
zIndex: 10000
|
|
2870
|
+
});
|
|
2871
|
+
fpolies.push(polygon);
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
});
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
function Display_DrawGS(locationsJson, offsetX, offsetY, vMapWidth) {
|
|
2849
2878
|
|
|
2850
2879
|
var locations = locationsJson;
|
|
2851
2880
|
bounds = new google.maps.LatLngBounds();
|
|
@@ -2902,7 +2931,6 @@ export class MapOverlayManager {
|
|
|
2902
2931
|
|
|
2903
2932
|
} else if(locations.length == 1) {
|
|
2904
2933
|
|
|
2905
|
-
|
|
2906
2934
|
var boundsChangedListener = google.maps.event.addListenerOnce(map, 'bounds_changed', function () {
|
|
2907
2935
|
if(!mapPanned) {
|
|
2908
2936
|
|
|
@@ -2919,7 +2947,7 @@ export class MapOverlayManager {
|
|
|
2919
2947
|
//map.fitBounds(bounds);
|
|
2920
2948
|
}
|
|
2921
2949
|
|
|
2922
|
-
function
|
|
2950
|
+
function GSGPRegions_DrawProductionRegions(gpRegionsJson, gsJson, selectedRegion, offsetX, offsetY, vMapWidth, isDashboard) {
|
|
2923
2951
|
|
|
2924
2952
|
mapListeners_clear();
|
|
2925
2953
|
polygonListeners_clear();
|
|
@@ -2930,8 +2958,22 @@ export class MapOverlayManager {
|
|
|
2930
2958
|
Display_DrawGPRegions(gpRegionsJson, selectedRegion, offsetX, offsetY);
|
|
2931
2959
|
GPRegions_BindPolyEvents(isDashboard);
|
|
2932
2960
|
|
|
2933
|
-
|
|
2934
|
-
|
|
2961
|
+
Display_DrawGS(gsJson, offsetX, offsetY, vMapWidth);
|
|
2962
|
+
GS_BindPolyEvents(isDashboard);
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
function GSProvinces_DrawProvinces(provincesJson, gsJson, selectedProvince, offsetX, offsetY, vMapWidth, isDashboard) {
|
|
2966
|
+
mapListeners_clear();
|
|
2967
|
+
polygonListeners_clear();
|
|
2968
|
+
markerListeners_clear();
|
|
2969
|
+
fmarkers_clear();
|
|
2970
|
+
fPolies_clear();
|
|
2971
|
+
|
|
2972
|
+
Display_DrawGSProvinces(provincesJson, selectedProvince, offsetX, offsetY);
|
|
2973
|
+
GSProvinces_BindPolyEvents(isDashboard);
|
|
2974
|
+
|
|
2975
|
+
Display_DrawGS(gsJson, offsetX, offsetY, vMapWidth);
|
|
2976
|
+
GS_BindPolyEvents(isDashboard);
|
|
2935
2977
|
}
|
|
2936
2978
|
|
|
2937
2979
|
function GPRegions_BindPolyEvents(isDashboard) {
|
|
@@ -2962,7 +3004,35 @@ export class MapOverlayManager {
|
|
|
2962
3004
|
});
|
|
2963
3005
|
}
|
|
2964
3006
|
|
|
2965
|
-
function
|
|
3007
|
+
function GSProvinces_BindPolyEvents(isDashboard) {
|
|
3008
|
+
deleteTooltip();
|
|
3009
|
+
|
|
3010
|
+
fpolies.forEach(function (poly) {
|
|
3011
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'mouseover', function (event) {
|
|
3012
|
+
poly.setOptions({strokeColor: '#f1a81e', strokeWeight: 3, zIndex: 10012});
|
|
3013
|
+
deleteTooltip();
|
|
3014
|
+
injectTooltip(event, poly.content);
|
|
3015
|
+
}));
|
|
3016
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'mousemove', moveTooltip));
|
|
3017
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'mouseout', function(event) {
|
|
3018
|
+
poly.setOptions({strokeColor: '#000000', strokeWeight: 3, zIndex: 10002});
|
|
3019
|
+
deleteTooltip();
|
|
3020
|
+
}));
|
|
3021
|
+
if(!isDashboard) {
|
|
3022
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'click', function (event) {
|
|
3023
|
+
deleteTooltip();
|
|
3024
|
+
eventHandlers["CSProvincePolyOnClick"]({
|
|
3025
|
+
type: 'SUCCESS',
|
|
3026
|
+
message: 'CSProvincePoly clicked',
|
|
3027
|
+
code: 200,
|
|
3028
|
+
data: poly.id,
|
|
3029
|
+
});
|
|
3030
|
+
}));
|
|
3031
|
+
}
|
|
3032
|
+
});
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
function GS_BindPolyEvents(isDashboard) {
|
|
2966
3036
|
|
|
2967
3037
|
deleteTooltip();
|
|
2968
3038
|
|
|
@@ -2986,7 +3056,7 @@ export class MapOverlayManager {
|
|
|
2986
3056
|
type: 'SUCCESS',
|
|
2987
3057
|
message: 'GSMarker clicked',
|
|
2988
3058
|
code: 200,
|
|
2989
|
-
data: ttc[0],
|
|
3059
|
+
data: parseInt(ttc[0]),
|
|
2990
3060
|
});
|
|
2991
3061
|
});
|
|
2992
3062
|
markerListeners.push(mclickListener);
|
|
@@ -3009,9 +3079,13 @@ export class MapOverlayManager {
|
|
|
3009
3079
|
});
|
|
3010
3080
|
}
|
|
3011
3081
|
|
|
3012
|
-
_this.
|
|
3013
|
-
|
|
3082
|
+
_this.RenderGSGPRegions = function(gpRegionsJson, gsJson, selectedRegion, offsetX, offsetY, vMapWidth, isDashboard) {
|
|
3083
|
+
GSGPRegions_DrawProductionRegions(gpRegionsJson, gsJson, selectedRegion, offsetX, offsetY, vMapWidth, isDashboard);
|
|
3014
3084
|
}
|
|
3085
|
+
|
|
3086
|
+
_this.RenderGSProvinces = function(provincesJson, gsJson, selectedProvince, offsetX, offsetY, vMapWidth, isDashboard) {
|
|
3087
|
+
GSProvinces_DrawProvinces(provincesJson, gsJson, selectedProvince, offsetX, offsetY, vMapWidth, isDashboard);
|
|
3088
|
+
}
|
|
3015
3089
|
|
|
3016
3090
|
_this.NDVI_AddOverlay_DEA = function (locationJson, ndviTileURL, validGMTiles, eosLocationCropperRefId, eosViewId, spinnerURL, spinnerLat, spinnerLon, paletteId, colorMapTypeIdValue, isFullView, onComplete) {
|
|
3017
3091
|
|