mapping-component-package-jp 0.0.18 → 0.0.20
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 +109 -25
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ export class MapOverlayManager {
|
|
|
21
21
|
RenderRegionFarms(locationsJson: any, icon: any, fitBounds: boolean): void;
|
|
22
22
|
RenderRegions(regionLocations: any[], properties: any, farmLocations: any[], icon: any): void;
|
|
23
23
|
RenderBackgroundFields(locations: any[], properties: any): void;
|
|
24
|
+
RenderSAAdministrative = function (saAdministrativeJson: any[], selectedSAProvince: number, selectedSADM: number, selectedSALM: number, selectedSAWard: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean);
|
|
24
25
|
|
|
25
26
|
// Shape Selection and Management
|
|
26
27
|
selectShape(shapeId: string | number, selectedStyle: any, unselectedStyle: any): void;
|
|
@@ -512,8 +512,8 @@ export class MapOverlayManager {
|
|
|
512
512
|
|
|
513
513
|
function fmarkers_clear() {
|
|
514
514
|
fmarkers.forEach(function (fm) {
|
|
515
|
-
fm.setMap(null);
|
|
516
|
-
fm.map = null;
|
|
515
|
+
fm.setMap(null);
|
|
516
|
+
//fm.map = null;
|
|
517
517
|
fm = null;
|
|
518
518
|
});
|
|
519
519
|
fmarkers = [];
|
|
@@ -521,8 +521,8 @@ export class MapOverlayManager {
|
|
|
521
521
|
|
|
522
522
|
_this.fmarkers_clear = function() {
|
|
523
523
|
fmarkers.forEach(function (fm) {
|
|
524
|
-
fm.setMap(null);
|
|
525
|
-
fm.map = null;
|
|
524
|
+
fm.setMap(null);
|
|
525
|
+
//fm.map = null;
|
|
526
526
|
fm = null;
|
|
527
527
|
});
|
|
528
528
|
fmarkers = [];
|
|
@@ -2383,11 +2383,96 @@ export class MapOverlayManager {
|
|
|
2383
2383
|
return true;
|
|
2384
2384
|
};
|
|
2385
2385
|
|
|
2386
|
+
function SAAdministrative_DrawSAAdministrative(saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vMapWidth, isDashboard) {
|
|
2387
|
+
//console.log('SAAdministrative_DrawSAAdministrative');
|
|
2388
|
+
//console.log(saAdministrativeJson);
|
|
2389
|
+
|
|
2390
|
+
mapListeners_clear();
|
|
2391
|
+
polygonListeners_clear();
|
|
2392
|
+
markerListeners_clear();
|
|
2393
|
+
fmarkers_clear();
|
|
2394
|
+
fPolies_clear();
|
|
2395
|
+
|
|
2396
|
+
Display_SAAdministrative(saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vMapWidth, isDashboard);
|
|
2397
|
+
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
function Display_SAAdministrative(saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vmWidth, isDashboard) {
|
|
2401
|
+
//console.log('Display_SAAdministrative');
|
|
2402
|
+
//console.log(saAdministrativeJson);
|
|
2403
|
+
|
|
2404
|
+
locations = JSON.parse(saAdministrativeJson, true);
|
|
2405
|
+
|
|
2406
|
+
var polygon = null;
|
|
2407
|
+
var path = null;
|
|
2408
|
+
var spolies, paths;
|
|
2409
|
+
bounds = new google.maps.LatLngBounds();
|
|
2410
|
+
|
|
2411
|
+
locations.forEach(function(v) {
|
|
2412
|
+
|
|
2413
|
+
spolies = v.poly.split(',');
|
|
2414
|
+
paths = [];
|
|
2415
|
+
spolies.forEach(function(p) {
|
|
2416
|
+
var sp = polyline.decode(p);
|
|
2417
|
+
path = [];
|
|
2418
|
+
sp.forEach(function(c) {
|
|
2419
|
+
path.push(new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1])));
|
|
2420
|
+
bounds.extend(new google.maps.LatLng(parseFloat(c[0]),parseFloat(c[1])));
|
|
2421
|
+
});
|
|
2422
|
+
paths.push(path);
|
|
2423
|
+
});
|
|
2424
|
+
|
|
2425
|
+
var pcontent = v.name;
|
|
2426
|
+
if(v.type == 'Ward') {
|
|
2427
|
+
pcontent = 'Ward '+v.name;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
polygon = new google.maps.Polygon({
|
|
2431
|
+
paths: paths,
|
|
2432
|
+
strokeColor: '#9ACD32',
|
|
2433
|
+
strokeOpacity: 1,
|
|
2434
|
+
strokeWeight: 3,
|
|
2435
|
+
fillColor: '#ffffff',
|
|
2436
|
+
fillOpacity: 0.3,
|
|
2437
|
+
zIndex: 10000,
|
|
2438
|
+
id: v.id,
|
|
2439
|
+
content: pcontent,
|
|
2440
|
+
type: v.type,
|
|
2441
|
+
map: map
|
|
2442
|
+
});
|
|
2443
|
+
fpolies.push(polygon);
|
|
2444
|
+
});
|
|
2445
|
+
/*
|
|
2446
|
+
if(selectedSAProvince === 0 && selectedSADM === 0 && selectedSALM === 0 && selectedSAWard === 0) {
|
|
2447
|
+
SAProvinces_BindPolyEvents(isDashboard);
|
|
2448
|
+
} else if(selectedSAProvince !== 0 && selectedSADM === 0 && selectedSALM === 0 && selectedSAWard === 0) {
|
|
2449
|
+
SADMs_BindPolyEvents(isDashboard);
|
|
2450
|
+
} else if(selectedSAProvince !== 0 && selectedSADM !== 0 && selectedSALM === 0 && selectedSAWard === 0) {
|
|
2451
|
+
SALMs_BindPolyEvents(isDashboard);
|
|
2452
|
+
} else if(selectedSAProvince !== 0 && selectedSADM !== 0 && selectedSALM !== 0 && selectedSAWard === 0) {
|
|
2453
|
+
SAWards_BindPolyEvents(isDashboard);
|
|
2454
|
+
} else if(selectedSAProvince !== 0 && selectedSADM !== 0 && selectedSALM !== 0 && selectedSAWard !== 0) {
|
|
2455
|
+
SAWards_BindPolyEvents(isDashboard);
|
|
2456
|
+
}
|
|
2457
|
+
*/
|
|
2458
|
+
var boundsChangedListener = google.maps.event.addListenerOnce(map, 'bounds_changed', function () {
|
|
2459
|
+
offsetCenter(map.getCenter(), offsetX, offsetY);
|
|
2460
|
+
});
|
|
2461
|
+
mapListeners.push(boundsChangedListener);
|
|
2462
|
+
|
|
2463
|
+
map.fitBounds(bounds);
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
_this.RenderSAAdministrative = function (saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vMapWidth, isDashboard) {
|
|
2467
|
+
SAAdministrative_DrawSAAdministrative(saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vMapWidth, isDashboard);
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
|
|
2386
2471
|
_this.NDVI_AddOverlay_DEA = function (locationJson, ndviTileURL, validGMTiles, eosLocationCropperRefId, eosViewId, spinnerURL, spinnerLat, spinnerLon, paletteId, colorMapTypeIdValue, isFullView, onComplete) {
|
|
2387
2472
|
|
|
2388
|
-
console.log('_this.NDVI_AddOverlay_DEA');
|
|
2473
|
+
//console.log('_this.NDVI_AddOverlay_DEA');
|
|
2389
2474
|
//console.log(locationJson);
|
|
2390
|
-
console.log('zoom at entry: '+map.getZoom());
|
|
2475
|
+
//console.log('zoom at entry: '+map.getZoom());
|
|
2391
2476
|
|
|
2392
2477
|
var locationParsed = locationJson;
|
|
2393
2478
|
var location = locationParsed[0];
|
|
@@ -2421,7 +2506,7 @@ export class MapOverlayManager {
|
|
|
2421
2506
|
|
|
2422
2507
|
var vgmTiles = vgmTilesIn;
|
|
2423
2508
|
|
|
2424
|
-
console.log(vgmTiles);
|
|
2509
|
+
//console.log(vgmTiles);
|
|
2425
2510
|
|
|
2426
2511
|
var spinnerSet = false;
|
|
2427
2512
|
|
|
@@ -2433,7 +2518,7 @@ export class MapOverlayManager {
|
|
|
2433
2518
|
spinnerImg.style.transform = 'translate(0, 50%)';
|
|
2434
2519
|
const position = new google.maps.LatLng(centerLat, centerLng);
|
|
2435
2520
|
|
|
2436
|
-
console.log(spinnerImg);
|
|
2521
|
+
//console.log(spinnerImg);
|
|
2437
2522
|
|
|
2438
2523
|
var spinnerMarker = new google.maps.marker.AdvancedMarkerElement({
|
|
2439
2524
|
map: map,
|
|
@@ -2449,7 +2534,7 @@ export class MapOverlayManager {
|
|
|
2449
2534
|
|
|
2450
2535
|
if (map.getZoom() > 17) {
|
|
2451
2536
|
|
|
2452
|
-
console.log('zoom > 17');
|
|
2537
|
+
//console.log('zoom > 17');
|
|
2453
2538
|
|
|
2454
2539
|
var zoomOnAddOverlayChangedListener = google.maps.event.addListenerOnce(map, 'zoom_changed', function () {
|
|
2455
2540
|
tilesToLoad = [];
|
|
@@ -2458,7 +2543,7 @@ export class MapOverlayManager {
|
|
|
2458
2543
|
getTileUrl: function (coord, zoom) {
|
|
2459
2544
|
if(vgmTiles.indexOf(zoom+'|'+coord.x+'|'+coord.y) > -1) {
|
|
2460
2545
|
const booleanFullView = fullView ? 'true' : 'false';
|
|
2461
|
-
console.log([ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join(''));
|
|
2546
|
+
//console.log([ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join(''));
|
|
2462
2547
|
tilesToLoad.push({eosLocationCropperRefId: eosLocationCropperRefId, eosViewId: eosViewId, z: zoom, x: coord.x, y: coord.y});
|
|
2463
2548
|
return [ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join('');
|
|
2464
2549
|
}
|
|
@@ -2489,7 +2574,7 @@ export class MapOverlayManager {
|
|
|
2489
2574
|
|
|
2490
2575
|
if(tilesToLoad.length > 0) {
|
|
2491
2576
|
const currentZoom = map.getZoom();
|
|
2492
|
-
console.log('currentZoom: '+currentZoom);
|
|
2577
|
+
//console.log('currentZoom: '+currentZoom);
|
|
2493
2578
|
|
|
2494
2579
|
let uniqueTilesToLoad = [];
|
|
2495
2580
|
tilesToLoad.forEach(function(ttl) {
|
|
@@ -2505,9 +2590,9 @@ export class MapOverlayManager {
|
|
|
2505
2590
|
}
|
|
2506
2591
|
});
|
|
2507
2592
|
|
|
2508
|
-
console.log('tilesToLoad.length: '+tilesToLoad.length);
|
|
2509
|
-
console.log('uniqueTilesToLoad.length: '+uniqueTilesToLoad.length);
|
|
2510
|
-
console.log('zoomTileCount: '+zoomTileCount);
|
|
2593
|
+
//console.log('tilesToLoad.length: '+tilesToLoad.length);
|
|
2594
|
+
//console.log('uniqueTilesToLoad.length: '+uniqueTilesToLoad.length);
|
|
2595
|
+
//console.log('zoomTileCount: '+zoomTileCount);
|
|
2511
2596
|
|
|
2512
2597
|
if(uniqueTilesToLoad.length == zoomTileCount) {
|
|
2513
2598
|
eventHandlers["OverlayTilesLoaded"]({
|
|
@@ -2545,8 +2630,7 @@ export class MapOverlayManager {
|
|
|
2545
2630
|
|
|
2546
2631
|
} else if (map.getZoom() < 13) {
|
|
2547
2632
|
|
|
2548
|
-
console.log('zoom < 13');
|
|
2549
|
-
|
|
2633
|
+
//console.log('zoom < 13');
|
|
2550
2634
|
|
|
2551
2635
|
var zoomOnAddOverlayChangedListener = google.maps.event.addListenerOnce(map, 'zoom_changed', function () {
|
|
2552
2636
|
|
|
@@ -2556,7 +2640,7 @@ export class MapOverlayManager {
|
|
|
2556
2640
|
getTileUrl: function (coord, zoom) {
|
|
2557
2641
|
if(vgmTiles.indexOf(zoom+'|'+coord.x+'|'+coord.y) > -1) {
|
|
2558
2642
|
const booleanFullView = fullView ? 'true' : 'false';
|
|
2559
|
-
console.log([ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join(''));
|
|
2643
|
+
//console.log([ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join(''));
|
|
2560
2644
|
tilesToLoad.push({eosLocationCropperRefId: eosLocationCropperRefId, eosViewId: eosViewId, z: zoom, x: coord.x, y: coord.y});
|
|
2561
2645
|
return [ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join('');
|
|
2562
2646
|
}
|
|
@@ -2586,7 +2670,7 @@ export class MapOverlayManager {
|
|
|
2586
2670
|
|
|
2587
2671
|
if(tilesToLoad.length > 0) {
|
|
2588
2672
|
const currentZoom = map.getZoom();
|
|
2589
|
-
console.log('currentZoom: '+currentZoom);
|
|
2673
|
+
//console.log('currentZoom: '+currentZoom);
|
|
2590
2674
|
|
|
2591
2675
|
let uniqueTilesToLoad = [];
|
|
2592
2676
|
tilesToLoad.forEach(function(ttl) {
|
|
@@ -2603,9 +2687,9 @@ export class MapOverlayManager {
|
|
|
2603
2687
|
}
|
|
2604
2688
|
})
|
|
2605
2689
|
|
|
2606
|
-
console.log('tilesToLoad.length: '+tilesToLoad.length);
|
|
2607
|
-
console.log('uniqueTilesToLoad.length: '+uniqueTilesToLoad.length);
|
|
2608
|
-
console.log('zoomTileCount: '+zoomTileCount);
|
|
2690
|
+
//console.log('tilesToLoad.length: '+tilesToLoad.length);
|
|
2691
|
+
//console.log('uniqueTilesToLoad.length: '+uniqueTilesToLoad.length);
|
|
2692
|
+
//console.log('zoomTileCount: '+zoomTileCount);
|
|
2609
2693
|
|
|
2610
2694
|
|
|
2611
2695
|
if(uniqueTilesToLoad.length == zoomTileCount) {
|
|
@@ -2652,7 +2736,7 @@ export class MapOverlayManager {
|
|
|
2652
2736
|
getTileUrl: function (coord, zoom) {
|
|
2653
2737
|
if(vgmTiles.indexOf(zoom+'|'+coord.x+'|'+coord.y) > -1) {
|
|
2654
2738
|
const booleanFullView = fullView ? 'true' : 'false';
|
|
2655
|
-
console.log([ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join(''));
|
|
2739
|
+
//console.log([ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join(''));
|
|
2656
2740
|
tilesToLoad.push({eosLocationCropperRefId: eosLocationCropperRefId, eosViewId: eosViewId, z: zoom, x: coord.x, y: coord.y});
|
|
2657
2741
|
return [ndviTileURL.replace(/{l}/,eosLocationCropperRefId).replace(/{v}/,eosViewId).replace(/{p}/,paletteId).replace(/{f}/,booleanFullView).replace(/{z}/,zoom).replace(/{x}/,coord.x).replace(/{y}/,coord.y)].join('');
|
|
2658
2742
|
}
|
|
@@ -2699,9 +2783,9 @@ export class MapOverlayManager {
|
|
|
2699
2783
|
}
|
|
2700
2784
|
})
|
|
2701
2785
|
|
|
2702
|
-
console.log('tilesToLoad.length: '+tilesToLoad.length);
|
|
2703
|
-
console.log('uniqueTilesToLoad.length: '+uniqueTilesToLoad.length);
|
|
2704
|
-
console.log('zoomTileCount: '+zoomTileCount);
|
|
2786
|
+
//console.log('tilesToLoad.length: '+tilesToLoad.length);
|
|
2787
|
+
//console.log('uniqueTilesToLoad.length: '+uniqueTilesToLoad.length);
|
|
2788
|
+
//console.log('zoomTileCount: '+zoomTileCount);
|
|
2705
2789
|
|
|
2706
2790
|
if(uniqueTilesToLoad.length == zoomTileCount) {
|
|
2707
2791
|
eventHandlers["OverlayTilesLoaded"]({
|