mapping-component-package-jp 0.0.26 → 0.0.27

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