mapping-component-package-jp 0.1.55 → 0.2.2
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
|
@@ -35,6 +35,7 @@ export class MapOverlayManager {
|
|
|
35
35
|
|
|
36
36
|
// Rendering Methods
|
|
37
37
|
RenderFields(locations: any[], properties: any, editMode?: boolean): void;
|
|
38
|
+
RenderFieldsMobile(locations: any[]): void;
|
|
38
39
|
RenderRegionFarms(locationsJson: any, icon: any, fitBounds: boolean, offsetX: number, offsetY: number): void;
|
|
39
40
|
RenderRegions(regionLocations: any[], properties: any, farmLocations: any[], icon: any, offsetX: number, offsetY: number): void;
|
|
40
41
|
RenderBackgroundFields(locations: any[], properties: any): void;
|
|
@@ -95,6 +95,12 @@ export class MapOverlayManager {
|
|
|
95
95
|
mapListeners.push(zoomChangedListener);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
function polygonsToMapMobile_set() {
|
|
99
|
+
polygons.forEach(function (p) {
|
|
100
|
+
p.setMap(map);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
98
104
|
function AddLabel(location, labelColour = "white") {
|
|
99
105
|
var polyCentroidCenter = get_polygon_centroid(location.Poly);
|
|
100
106
|
var labelLat = polyCentroidCenter.y;
|
|
@@ -144,6 +150,14 @@ export class MapOverlayManager {
|
|
|
144
150
|
});
|
|
145
151
|
}
|
|
146
152
|
|
|
153
|
+
function fields_BindPolyEventsMobile() {
|
|
154
|
+
polygons.forEach(function (poly) {
|
|
155
|
+
polygonListeners.push(google.maps.event.addListener(poly, 'click', function (event) {
|
|
156
|
+
eventHandlers["FieldOnClick"](this.id);
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
147
161
|
function farms_BindMarkerEvents() {
|
|
148
162
|
deleteTooltip();
|
|
149
163
|
fmarkers.forEach(function (marker) {
|
|
@@ -335,8 +349,6 @@ export class MapOverlayManager {
|
|
|
335
349
|
return map.overlayMapTypes;
|
|
336
350
|
}
|
|
337
351
|
|
|
338
|
-
|
|
339
|
-
//#DRAW/DISPLAY FIELDS
|
|
340
352
|
_this.RenderFields = function (locations, properties) {
|
|
341
353
|
var mbounds = new google.maps.LatLngBounds();
|
|
342
354
|
|
|
@@ -399,6 +411,39 @@ export class MapOverlayManager {
|
|
|
399
411
|
polygonsToMap_set();
|
|
400
412
|
};
|
|
401
413
|
|
|
414
|
+
_this.RenderFieldsMobile = function (locations) {
|
|
415
|
+
var mbounds = new google.maps.LatLngBounds();
|
|
416
|
+
|
|
417
|
+
locations.forEach(function (location) {
|
|
418
|
+
if (location && location.Poly && location.Poly.length > 0 && location.Id.length > 0) {
|
|
419
|
+
var paths = location.Poly.map(poly => poly.map(v => new google.maps.LatLng(parseFloat(v[1]), parseFloat(v[0]))));
|
|
420
|
+
paths[0].forEach(coord => mbounds.extend(coord));
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
var polygonOptions = {
|
|
424
|
+
paths: paths,
|
|
425
|
+
id: location.Id,
|
|
426
|
+
strokeColor: location.MapLocationFeature.StrokeColor,
|
|
427
|
+
strokeOpacity: location.MapLocationFeature.StrokeOpacity,
|
|
428
|
+
strokeWeight: location.MapLocationFeature.StrokeWeight,
|
|
429
|
+
fillColor: location.MapLocationFeature.FillColor,
|
|
430
|
+
fillOpacity: location.MapLocationFeature.FillOpacity,
|
|
431
|
+
zIndex: location.MapLocationFeature.ZIndex
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
var polygon = new google.maps.Polygon(polygonOptions);
|
|
435
|
+
polygons.push(polygon);
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
polygonsToMapMobile_set();
|
|
440
|
+
|
|
441
|
+
map.fitBounds(mbounds);
|
|
442
|
+
|
|
443
|
+
fields_BindPolyEventsMobile();
|
|
444
|
+
|
|
445
|
+
};
|
|
446
|
+
|
|
402
447
|
_this.destroy = function () {
|
|
403
448
|
mapId = null;
|
|
404
449
|
mapConfig = null;
|