mapping-component-package-jp 0.0.29 → 0.0.31

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.29",
3
+ "version": "0.0.31",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -2504,6 +2504,12 @@ export class MapOverlayManager {
2504
2504
  console.log('SACadastral, map on dragend, zoom < 12 or zoom > 17');
2505
2505
  mapListeners_clear();
2506
2506
  fPolies_clear();
2507
+ eventHandlers["ReloadCadastralData"]({
2508
+ type: 'SUCCESS',
2509
+ message: 'Reload cadastral data on dragend',
2510
+ code: 200,
2511
+ data: null
2512
+ });
2507
2513
  }
2508
2514
  });
2509
2515
  mapListeners.push(mdeListener);
@@ -2521,10 +2527,39 @@ export class MapOverlayManager {
2521
2527
  console.log('SACadastral, map on zoom changed, zoom < 12 or zoom > 17');
2522
2528
  mapListeners_clear();
2523
2529
  fPolies_clear();
2530
+ eventHandlers["ReloadCadastralData"]({
2531
+ type: 'SUCCESS',
2532
+ message: 'Reload cadastral data on zoom changed',
2533
+ code: 200,
2534
+ data: null
2535
+ });
2524
2536
  }
2525
2537
  });
2526
2538
  mapListeners.push(mzcListener);
2527
2539
 
2540
+ var mbcListener = google.maps.event.addListener(map, 'bounds_changed', function() {
2541
+ if(map.getZoom() >= 12 && map.getZoom() <= 17) {
2542
+ console.log('SACadastral, map on bounds changed, zoom >= 12 and zoom <= 17');
2543
+ eventHandlers["ReloadCadastralData"]({
2544
+ type: 'SUCCESS',
2545
+ message: 'Reload cadastral data on bounds changed',
2546
+ code: 200,
2547
+ data: null
2548
+ });
2549
+ } else {
2550
+ console.log('SACadastral, map on bounds changed, zoom < 12 or zoom > 17');
2551
+ mapListeners_clear();
2552
+ fPolies_clear();
2553
+ eventHandlers["ReloadCadastralData"]({
2554
+ type: 'SUCCESS',
2555
+ message: 'Reload cadastral data on bounds changed',
2556
+ code: 200,
2557
+ data: null
2558
+ });
2559
+ }
2560
+ });
2561
+ mapListeners.push(mbcListener);
2562
+
2528
2563
  Display_SACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
2529
2564
  }
2530
2565
 
@@ -2570,8 +2605,8 @@ export class MapOverlayManager {
2570
2605
  }
2571
2606
 
2572
2607
  var carea = v.geomarea/10000;
2573
- //var content = 'Farm: '+v.name+'<br>'+v.lpi+'<br>'+carea.toFixed(2)+' ha';
2574
- var content = 'Farm: '+v.name+'<br>';//+v.lpi+'<br>'+carea.toFixed(2)+' ha';
2608
+ var content = 'Farm: '+v.name+'<br>'+v.lpi+'<br>'+carea.toFixed(2)+' ha';
2609
+ //var content = 'Farm: '+v.name+'<br>';//+v.lpi+'<br>'+carea.toFixed(2)+' ha';
2575
2610
 
2576
2611
  var fpoly = new google.maps.Polygon({
2577
2612
  map: map,
@@ -2583,6 +2618,7 @@ export class MapOverlayManager {
2583
2618
  fillOpacity: 0.01,
2584
2619
  id: v.id,
2585
2620
  content: content,
2621
+ type: 'pf',
2586
2622
  zIndex: 10001,
2587
2623
  });
2588
2624
 
@@ -2630,6 +2666,7 @@ export class MapOverlayManager {
2630
2666
  }
2631
2667
 
2632
2668
  var carea = v.geomarea/10000;
2669
+ var content = 'Farm: '+v.farm+'<br>Portion: '+v.name+'<br>'+v.lpi+'<br>'+carea.toFixed(2)+' ha';
2633
2670
 
2634
2671
  var fpoly = new google.maps.Polygon({
2635
2672
  map: map,
@@ -2640,11 +2677,9 @@ export class MapOverlayManager {
2640
2677
  fillColor: '#000000',
2641
2678
  fillOpacity: 0.01,
2642
2679
  id: v.id,
2643
- name: v.name,
2644
- farm: '',
2645
- //lpi: v.lpi,
2646
- area: carea.toFixed(2),
2647
- zIndex: 10001,
2680
+ content: content,
2681
+ type: 'fp',
2682
+ zIndex: 10002,
2648
2683
  });
2649
2684
 
2650
2685
  if(fitBounds) {
@@ -2691,6 +2726,7 @@ export class MapOverlayManager {
2691
2726
  }
2692
2727
 
2693
2728
  var carea = v.geomarea/10000;
2729
+ var content = 'Erf: '+v.name+'<br>'+v.lpi+'<br>'+carea.toFixed(2)+' ha';
2694
2730
 
2695
2731
  var fpoly = new google.maps.Polygon({
2696
2732
  map: map,
@@ -2701,11 +2737,9 @@ export class MapOverlayManager {
2701
2737
  fillColor: '#000000',
2702
2738
  fillOpacity: 0.01,
2703
2739
  id: v.id,
2704
- name: v.name,
2705
- farm: '',
2706
- //lpi: v.lpi,
2707
- area: carea.toFixed(2),
2708
- zIndex: 10001,
2740
+ content: content,
2741
+ type: 'er',
2742
+ zIndex: 10003,
2709
2743
  });
2710
2744
 
2711
2745
  if(fitBounds) {
@@ -2714,20 +2748,46 @@ export class MapOverlayManager {
2714
2748
  fpolies.push(fpoly);
2715
2749
  });
2716
2750
  }
2751
+ SACadastral_BindPolyEvents(isDashboard);
2752
+ }
2717
2753
 
2754
+ function SACadastral_BindPolyEvents(isDashboard) {
2755
+ deleteTooltip();
2718
2756
 
2719
- /*
2720
- if(type == 'pf') {
2721
- addListeners(pfpolies, type);
2722
- } else if(type == 'fp') {
2723
- addListeners(fppolies, type);
2724
- } else if(type == 'er') {
2725
- addListeners(erpolies, type);
2726
- }
2727
- */
2728
-
2757
+ fpolies.forEach(function (poly) {
2758
+ polygonListeners.push(google.maps.event.addListener(poly, 'mouseover', function (event) {
2759
+ if(poly.type == 'pf') {
2760
+ poly.setOptions({strokeColor: '#f1a81e', strokeWeight: 5, zIndex: 10011});
2761
+ } else if(poly.type == 'fp') {
2762
+ poly.setOptions({strokeColor: '#f1a81e', strokeWeight: 3, zIndex: 10012});
2763
+ } else if(poly.type == 'er') {
2764
+ poly.setOptions({strokeColor: '#f1a81e', strokeWeight: 1, zIndex: 10013});
2765
+ }
2766
+
2767
+ deleteTooltip();
2768
+ injectTooltip(event, poly.content);
2769
+ }));
2770
+ polygonListeners.push(google.maps.event.addListener(poly, 'mousemove', moveTooltip));
2771
+ polygonListeners.push(google.maps.event.addListener(poly, 'mouseout', function(event) {
2772
+ if(poly.type == 'pf') {
2773
+ poly.setOptions({strokeColor: '#000000', strokeWeight: 5, zIndex: 10001});
2774
+ } else if(poly.type == 'fp') {
2775
+ poly.setOptions({strokeColor: '#000000', strokeWeight: 3, zIndex: 10002});
2776
+ } else if(poly.type == 'er') {
2777
+ poly.setOptions({strokeColor: '#000000', strokeWeight: 1, zIndex: 10003});
2778
+ }
2779
+ deleteTooltip();
2780
+ }));
2781
+ if(!isDashboard) {
2782
+ polygonListeners.push(google.maps.event.addListener(poly, 'click', function (event) {
2783
+ deleteTooltip();
2784
+ eventHandlers["SACadastralPolyOnClick"](this.id);
2785
+ }));
2786
+ }
2787
+ });
2729
2788
  }
2730
2789
 
2790
+
2731
2791
  _this.RenderSACadastral = function (saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
2732
2792
  SACadastral_DrawSACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
2733
2793
  }