mapping-component-package-jp 0.0.26 → 0.0.28
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
|
@@ -2484,8 +2484,11 @@ export class MapOverlayManager {
|
|
|
2484
2484
|
fmarkers_clear();
|
|
2485
2485
|
fPolies_clear();
|
|
2486
2486
|
|
|
2487
|
+
console.log('SACadastral_DrawSACadastral before adding map listeners');
|
|
2488
|
+
|
|
2487
2489
|
var mdeListener = google.maps.event.addListener(map, 'dragend', function() {
|
|
2488
2490
|
if(map.getZoom() >= 12 && map.getZoom() <= 17) {
|
|
2491
|
+
console.log('SACadastral, map on dragend, zoom >= 12 and zoom <= 17');
|
|
2489
2492
|
eventHandlers["ReloadCadastralData"]({
|
|
2490
2493
|
type: 'SUCCESS',
|
|
2491
2494
|
message: 'Reload cadastral data on dragend',
|
|
@@ -2494,6 +2497,7 @@ export class MapOverlayManager {
|
|
|
2494
2497
|
});
|
|
2495
2498
|
|
|
2496
2499
|
} else {
|
|
2500
|
+
console.log('SACadastral, map on dragend, zoom < 12 or zoom > 17');
|
|
2497
2501
|
mapListeners_clear();
|
|
2498
2502
|
fPolies_clear();
|
|
2499
2503
|
}
|
|
@@ -2502,6 +2506,7 @@ export class MapOverlayManager {
|
|
|
2502
2506
|
|
|
2503
2507
|
var mzcListener = google.maps.event.addListener(map, 'zoom_changed', function() {
|
|
2504
2508
|
if(map.getZoom() >= 12 && map.getZoom() <= 17) {
|
|
2509
|
+
console.log('SACadastral, map on zoom changed, zoom >= 12 and zoom <= 17');
|
|
2505
2510
|
eventHandlers["ReloadCadastralData"]({
|
|
2506
2511
|
type: 'SUCCESS',
|
|
2507
2512
|
message: 'Reload cadastral data on zoom changed',
|
|
@@ -2509,13 +2514,14 @@ export class MapOverlayManager {
|
|
|
2509
2514
|
data: null
|
|
2510
2515
|
});
|
|
2511
2516
|
} else {
|
|
2517
|
+
console.log('SACadastral, map on zoom changed, zoom < 12 or zoom > 17');
|
|
2512
2518
|
mapListeners_clear();
|
|
2513
2519
|
fPolies_clear();
|
|
2514
2520
|
}
|
|
2515
2521
|
});
|
|
2516
2522
|
mapListeners.push(mzcListener);
|
|
2517
2523
|
|
|
2518
|
-
Display_SACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard);
|
|
2524
|
+
Display_SACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
|
|
2519
2525
|
}
|
|
2520
2526
|
|
|
2521
2527
|
function Display_SACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
|
|
@@ -2560,6 +2566,8 @@ export class MapOverlayManager {
|
|
|
2560
2566
|
}
|
|
2561
2567
|
|
|
2562
2568
|
var carea = v.geomarea/10000;
|
|
2569
|
+
//var content = 'Farm: '+v.name+'<br>'+v.lpi+'<br>'+carea.toFixed(2)+' ha';
|
|
2570
|
+
var content = 'Farm: '+v.name+'<br>';//+v.lpi+'<br>'+carea.toFixed(2)+' ha';
|
|
2563
2571
|
|
|
2564
2572
|
var fpoly = new google.maps.Polygon({
|
|
2565
2573
|
map: map,
|
|
@@ -2567,8 +2575,66 @@ export class MapOverlayManager {
|
|
|
2567
2575
|
strokeWeight: 5,
|
|
2568
2576
|
strokeColor: '#000000',
|
|
2569
2577
|
strokeOpacity: 1,
|
|
2570
|
-
fillColor: '
|
|
2571
|
-
fillOpacity:
|
|
2578
|
+
fillColor: '#000000',
|
|
2579
|
+
fillOpacity: 0.01,
|
|
2580
|
+
id: v.id,
|
|
2581
|
+
content: content,
|
|
2582
|
+
zIndex: 10001,
|
|
2583
|
+
});
|
|
2584
|
+
|
|
2585
|
+
if(fitBounds) {
|
|
2586
|
+
map.fitBounds(bounds);
|
|
2587
|
+
}
|
|
2588
|
+
fpolies.push(fpoly);
|
|
2589
|
+
});
|
|
2590
|
+
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
if(farmPortionsJson.length > 0) {
|
|
2594
|
+
farmPortionsJson.forEach(function(v) {
|
|
2595
|
+
if(fitBounds) {
|
|
2596
|
+
bounds = new google.maps.LatLngBounds();
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
var geojson = JSON.parse(v.geojson,true);
|
|
2600
|
+
|
|
2601
|
+
if(geojson.type == 'Polygon') {
|
|
2602
|
+
|
|
2603
|
+
var paths = [];
|
|
2604
|
+
var path = [];
|
|
2605
|
+
|
|
2606
|
+
geojson.coordinates[0].forEach(function(c,ci) {
|
|
2607
|
+
path.push(new google.maps.LatLng(c[1],c[0]));
|
|
2608
|
+
if(fitBounds) {
|
|
2609
|
+
bounds.extend(new google.maps.LatLng(c[1],c[0]));
|
|
2610
|
+
}
|
|
2611
|
+
});
|
|
2612
|
+
paths.push(path);
|
|
2613
|
+
|
|
2614
|
+
} else if(geojson.type == 'MultiPolygon') {
|
|
2615
|
+
var paths = [];
|
|
2616
|
+
geojson.coordinates.forEach(function(p,pi) {
|
|
2617
|
+
var path = [];
|
|
2618
|
+
p[0].forEach(function(c,ci) {
|
|
2619
|
+
path.push(new google.maps.LatLng(c[1],c[0]));
|
|
2620
|
+
if(fitBounds) {
|
|
2621
|
+
bounds.extend(new google.maps.LatLng(c[1],c[0]));
|
|
2622
|
+
}
|
|
2623
|
+
});
|
|
2624
|
+
paths.push(path);
|
|
2625
|
+
});
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
var carea = v.geomarea/10000;
|
|
2629
|
+
|
|
2630
|
+
var fpoly = new google.maps.Polygon({
|
|
2631
|
+
map: map,
|
|
2632
|
+
paths: paths,
|
|
2633
|
+
strokeWeight: 3,
|
|
2634
|
+
strokeColor: '#000000',
|
|
2635
|
+
strokeOpacity: 1,
|
|
2636
|
+
fillColor: '#000000',
|
|
2637
|
+
fillOpacity: 0.01,
|
|
2572
2638
|
id: v.id,
|
|
2573
2639
|
name: v.name,
|
|
2574
2640
|
farm: '',
|
|
@@ -2584,7 +2650,67 @@ export class MapOverlayManager {
|
|
|
2584
2650
|
});
|
|
2585
2651
|
|
|
2586
2652
|
}
|
|
2653
|
+
|
|
2654
|
+
if(ervenJson.length > 0) {
|
|
2655
|
+
ervenJson.forEach(function(v) {
|
|
2656
|
+
if(fitBounds) {
|
|
2657
|
+
bounds = new google.maps.LatLngBounds();
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
var geojson = JSON.parse(v.geojson,true);
|
|
2661
|
+
|
|
2662
|
+
if(geojson.type == 'Polygon') {
|
|
2663
|
+
|
|
2664
|
+
var paths = [];
|
|
2665
|
+
var path = [];
|
|
2666
|
+
|
|
2667
|
+
geojson.coordinates[0].forEach(function(c,ci) {
|
|
2668
|
+
path.push(new google.maps.LatLng(c[1],c[0]));
|
|
2669
|
+
if(fitBounds) {
|
|
2670
|
+
bounds.extend(new google.maps.LatLng(c[1],c[0]));
|
|
2671
|
+
}
|
|
2672
|
+
});
|
|
2673
|
+
paths.push(path);
|
|
2674
|
+
|
|
2675
|
+
} else if(geojson.type == 'MultiPolygon') {
|
|
2676
|
+
var paths = [];
|
|
2677
|
+
geojson.coordinates.forEach(function(p,pi) {
|
|
2678
|
+
var path = [];
|
|
2679
|
+
p[0].forEach(function(c,ci) {
|
|
2680
|
+
path.push(new google.maps.LatLng(c[1],c[0]));
|
|
2681
|
+
if(fitBounds) {
|
|
2682
|
+
bounds.extend(new google.maps.LatLng(c[1],c[0]));
|
|
2683
|
+
}
|
|
2684
|
+
});
|
|
2685
|
+
paths.push(path);
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
var carea = v.geomarea/10000;
|
|
2690
|
+
|
|
2691
|
+
var fpoly = new google.maps.Polygon({
|
|
2692
|
+
map: map,
|
|
2693
|
+
paths: paths,
|
|
2694
|
+
strokeWeight: 1,
|
|
2695
|
+
strokeColor: '#000000',
|
|
2696
|
+
strokeOpacity: 1,
|
|
2697
|
+
fillColor: '#000000',
|
|
2698
|
+
fillOpacity: 0.01,
|
|
2699
|
+
id: v.id,
|
|
2700
|
+
name: v.name,
|
|
2701
|
+
farm: '',
|
|
2702
|
+
//lpi: v.lpi,
|
|
2703
|
+
area: carea.toFixed(2),
|
|
2704
|
+
zIndex: 10001,
|
|
2705
|
+
});
|
|
2587
2706
|
|
|
2707
|
+
if(fitBounds) {
|
|
2708
|
+
map.fitBounds(bounds);
|
|
2709
|
+
}
|
|
2710
|
+
fpolies.push(fpoly);
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2588
2714
|
|
|
2589
2715
|
/*
|
|
2590
2716
|
if(type == 'pf') {
|