mapping-component-package-jp 0.0.45 → 0.0.47
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 +1 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/js/mapEncapsulation/mapOverlayManager.d.ts +1 -0
- package/src/js/mapEncapsulation/mapOverlayManager.js +180 -0
package/package.json
CHANGED
|
@@ -23,6 +23,7 @@ export class MapOverlayManager {
|
|
|
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
|
+
RenderSADelineatedFields(saDelineatedFieldsJson: any, offsetX: number, offsetY: number, vmWidth: number, isDashboard: boolean, fitBounds: boolean): void;
|
|
26
27
|
RenderGSGPRegions(gpRegionsJson: any[], gsByRegionJson: any[], selectedRegion: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean): void;
|
|
27
28
|
RenderGSProvinces(provincesJson: any[], gsByProvinceJson: any[], selectedProvince: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean): void;
|
|
28
29
|
|
|
@@ -2818,6 +2818,186 @@ export class MapOverlayManager {
|
|
|
2818
2818
|
SACadastral_DrawSACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
|
|
2819
2819
|
}
|
|
2820
2820
|
|
|
2821
|
+
function SADelineatedFields_DrawSADelineatedFields(saDelineatedFieldsJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
|
|
2822
|
+
mapListeners_clear();
|
|
2823
|
+
polygonListeners_clear();
|
|
2824
|
+
markerListeners_clear();
|
|
2825
|
+
fmarkers_clear();
|
|
2826
|
+
fPolies_clear();
|
|
2827
|
+
|
|
2828
|
+
var mdeListener = google.maps.event.addListener(map, 'dragend', function() {
|
|
2829
|
+
if(map.getZoom() >= 13 && map.getZoom() <= 17) {
|
|
2830
|
+
eventHandlers["ReloadDelineatedFieldsData"]({
|
|
2831
|
+
type: 'SUCCESS',
|
|
2832
|
+
message: 'Reload delineated fields data on dragend',
|
|
2833
|
+
code: 200,
|
|
2834
|
+
data: null
|
|
2835
|
+
});
|
|
2836
|
+
|
|
2837
|
+
} else {
|
|
2838
|
+
|
|
2839
|
+
mapListeners_clear();
|
|
2840
|
+
fPolies_clear();
|
|
2841
|
+
if(map.getZoom() < 13) {
|
|
2842
|
+
map.setZoom(13);
|
|
2843
|
+
}
|
|
2844
|
+
if(map.getZoom() > 17) {
|
|
2845
|
+
map.setZoom(17);
|
|
2846
|
+
}
|
|
2847
|
+
eventHandlers["ReloadDelineatedFieldsData"]({
|
|
2848
|
+
type: 'SUCCESS',
|
|
2849
|
+
message: 'Reload delineated fields data on dragend, zoom outside range',
|
|
2850
|
+
code: 200,
|
|
2851
|
+
data: null
|
|
2852
|
+
});
|
|
2853
|
+
}
|
|
2854
|
+
});
|
|
2855
|
+
mapListeners.push(mdeListener);
|
|
2856
|
+
|
|
2857
|
+
var mzcListener = google.maps.event.addListener(map, 'zoom_changed', function() {
|
|
2858
|
+
if(map.getZoom() >= 13 && map.getZoom() <= 17) {
|
|
2859
|
+
eventHandlers["ReloadDelineatedFieldsData"]({
|
|
2860
|
+
type: 'SUCCESS',
|
|
2861
|
+
message: 'Reload delineated fields data on zoom changed',
|
|
2862
|
+
code: 200,
|
|
2863
|
+
data: null
|
|
2864
|
+
});
|
|
2865
|
+
|
|
2866
|
+
} else {
|
|
2867
|
+
|
|
2868
|
+
mapListeners_clear();
|
|
2869
|
+
fPolies_clear();
|
|
2870
|
+
if(map.getZoom() < 13) {
|
|
2871
|
+
map.setZoom(13);
|
|
2872
|
+
}
|
|
2873
|
+
if(map.getZoom() > 17) {
|
|
2874
|
+
map.setZoom(17);
|
|
2875
|
+
}
|
|
2876
|
+
eventHandlers["ReloadDelineatedFieldsData"]({
|
|
2877
|
+
type: 'SUCCESS',
|
|
2878
|
+
message: 'Reload delineated fields data on zoom changed, zoom outside range',
|
|
2879
|
+
code: 200,
|
|
2880
|
+
data: null
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
});
|
|
2884
|
+
mapListeners.push(mzcListener);
|
|
2885
|
+
|
|
2886
|
+
var mbcListener = google.maps.event.addListenerOnce(map, 'bounds_changed', function() {
|
|
2887
|
+
if(map.getZoom() >= 13 && map.getZoom() <= 17) {
|
|
2888
|
+
eventHandlers["ReloadDelineatedFieldsData"]({
|
|
2889
|
+
type: 'SUCCESS',
|
|
2890
|
+
message: 'Reload delineated fields data on bounds changed',
|
|
2891
|
+
code: 200,
|
|
2892
|
+
data: null
|
|
2893
|
+
});
|
|
2894
|
+
|
|
2895
|
+
} else {
|
|
2896
|
+
|
|
2897
|
+
mapListeners_clear();
|
|
2898
|
+
fPolies_clear();
|
|
2899
|
+
if(map.getZoom() < 13) {
|
|
2900
|
+
map.setZoom(13);
|
|
2901
|
+
}
|
|
2902
|
+
if(map.getZoom() > 17) {
|
|
2903
|
+
map.setZoom(17);
|
|
2904
|
+
}
|
|
2905
|
+
eventHandlers["ReloadDelineatedFieldsData"]({
|
|
2906
|
+
type: 'SUCCESS',
|
|
2907
|
+
message: 'Reload delineated fields data on bounds changed, zoom outside range',
|
|
2908
|
+
code: 200,
|
|
2909
|
+
data: null
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
});
|
|
2913
|
+
mapListeners.push(mbcListener);
|
|
2914
|
+
|
|
2915
|
+
if(map.getZoom() >= 13 && map.getZoom() <= 17) {
|
|
2916
|
+
Display_SADelineatedFields(saDelineatedFieldsJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
function Display_SADelineatedFields(saDelineatedFieldsJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
|
|
2921
|
+
|
|
2922
|
+
var locations = saDelineatedFieldsJson;
|
|
2923
|
+
|
|
2924
|
+
if(locations && locations.length > 0) {
|
|
2925
|
+
locations.forEach(function(v) {
|
|
2926
|
+
if(fitBounds) {
|
|
2927
|
+
bounds = new google.maps.LatLngBounds();
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
var spolies = v.poly.split(',');
|
|
2931
|
+
var paths = [];
|
|
2932
|
+
spolies.forEach(function(p) {
|
|
2933
|
+
var sp = polyline.decode(p);
|
|
2934
|
+
var path = [];
|
|
2935
|
+
sp.forEach(function(c) {
|
|
2936
|
+
path.push(new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1])));
|
|
2937
|
+
if(fitBounds) {
|
|
2938
|
+
bounds.extend(new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1])));
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
paths.push(path);
|
|
2942
|
+
});
|
|
2943
|
+
|
|
2944
|
+
var area = v.area/10000;
|
|
2945
|
+
var content = v.category+'<br>'+area.toFixed(2)+' ha';
|
|
2946
|
+
|
|
2947
|
+
var fpoly = new google.maps.Polygon({
|
|
2948
|
+
map: map,
|
|
2949
|
+
paths: paths,
|
|
2950
|
+
strokeWeight: 3,
|
|
2951
|
+
strokeColor: '#000000',
|
|
2952
|
+
strokeOpacity: 1,
|
|
2953
|
+
fillColor: '#000000',
|
|
2954
|
+
fillOpacity: 0.01,
|
|
2955
|
+
id: v.id,
|
|
2956
|
+
content: content,
|
|
2957
|
+
zIndex: 10001,
|
|
2958
|
+
});
|
|
2959
|
+
|
|
2960
|
+
if(fitBounds) {
|
|
2961
|
+
map.fitBounds(bounds);
|
|
2962
|
+
}
|
|
2963
|
+
fpolies.push(fpoly);
|
|
2964
|
+
});
|
|
2965
|
+
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
SADelineatedFields_BindPolyEvents(isDashboard);
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
function SADelineatedFields_BindPolyEvents(isDashboard) {
|
|
2972
|
+
deleteTooltip();
|
|
2973
|
+
|
|
2974
|
+
fpolies.forEach(function (poly) {
|
|
2975
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'mouseover', function (event) {
|
|
2976
|
+
poly.setOptions({strokeColor: '#f1a81e', strokeWeight: 3, zIndex: 10011});
|
|
2977
|
+
deleteTooltip();
|
|
2978
|
+
injectTooltip(event, poly.content);
|
|
2979
|
+
}));
|
|
2980
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'mousemove', moveTooltip));
|
|
2981
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'mouseout', function(event) {
|
|
2982
|
+
poly.setOptions({strokeColor: '#000000', strokeWeight: 3, zIndex: 10001});
|
|
2983
|
+
deleteTooltip();
|
|
2984
|
+
}));
|
|
2985
|
+
if(!isDashboard) {
|
|
2986
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'click', function (event) {
|
|
2987
|
+
deleteTooltip();
|
|
2988
|
+
eventHandlers["SADelineatedFieldPolyOnClick"](this.id);
|
|
2989
|
+
}));
|
|
2990
|
+
}
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
_this.RenderSADelineatedFields = function (saDelineatedFieldsJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
|
|
2995
|
+
SADelineatedFields_DrawSADelineatedFields(saDelineatedFieldsJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
|
|
2821
3001
|
function Display_DrawGPRegions(locationsJson, selectedRegion, offsetX, offsetY) {
|
|
2822
3002
|
var polygon = null;
|
|
2823
3003
|
var locations = locationsJson;
|