mapping-component-package-jp 0.1.13 → 0.1.15

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.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -50,7 +50,7 @@ export class MapOverlayManager {
50
50
  CircleSegment_Edit(ShapeId: string | number, isMobile: boolean): void;
51
51
 
52
52
  // Field Management
53
- DrawField_DrawLocation(locationsJson: string, locationId: any, shapeConfig: any): void;
53
+ DrawField_DrawLocation(locationsJson: string, selectedFarmIdentifier: string, locationId: any, shapeConfig: any): void;
54
54
  TriggerField_ChangeEvent(): any;
55
55
  DrawField_AttachEvents(eHandlers: any): void;
56
56
  DrawField_DetachEvents(StrokeColor: string, SelectedShapeId: string): void;
@@ -130,6 +130,8 @@ export class MapOverlayManager {
130
130
  function fields_BindPolyEvents() {
131
131
  deleteTooltip();
132
132
 
133
+ console.log('mapOverlayManager, fields_BindPolyEvents', polygons);
134
+
133
135
  polygons.forEach(function (poly) {
134
136
  polygonListeners.push(google.maps.event.addListener(poly, 'mouseover', function (event) {
135
137
  deleteTooltip();
@@ -631,7 +633,7 @@ export class MapOverlayManager {
631
633
 
632
634
  // #endregion
633
635
 
634
- _this.DrawField_DrawLocation = function (locationsJson, locationId, shapeConfig) {
636
+ _this.DrawField_DrawLocation = function (locationsJson, selectedFarmIdentifier, locationId, shapeConfig) {
635
637
 
636
638
  locations = JSON.parse(locationsJson, true);
637
639
 
@@ -643,7 +645,9 @@ export class MapOverlayManager {
643
645
  if(location && location.Poly && location.Poly.length > 0 && location.Id > 0) {
644
646
 
645
647
  var paths = location.Poly.map(poly => poly.map(v => new google.maps.LatLng(parseFloat(v[1]), parseFloat(v[0]))));
646
- paths[0].forEach(coord => mbounds.extend(coord));
648
+ if(location.FarmIdentifier == selectedFarmIdentifier) {
649
+ paths[0].forEach(coord => mbounds.extend(coord));
650
+ }
647
651
 
648
652
  let content = `${location.FarmName} - ${location.LocationName}<br>${location.Area} ha${location.IsIrrigated ? ', irrigated' : ''}`;
649
653
 
@@ -662,7 +666,7 @@ export class MapOverlayManager {
662
666
  if (location.Id == locationId) {
663
667
 
664
668
  var pArea = google.maps.geometry.spherical.computeSignedArea(path);
665
- var isHole = pArea > 0 && pi !== 0;
669
+ var isHole = pArea > 0 && lpi !== 0;
666
670
  cpid = Date.now() + Math.floor(Math.random() * 100000);
667
671
 
668
672
  var polygon = new google.maps.Polygon({
@@ -733,7 +737,7 @@ export class MapOverlayManager {
733
737
  }
734
738
  });
735
739
 
736
- map.fitBounds(bounds);
740
+ map.fitBounds(mbounds);
737
741
  fields_BindPolyEvents();
738
742
  //console.log(polygons);
739
743
  }