mapping-component-package-jp 0.0.24 → 0.0.26

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.24",
3
+ "version": "0.0.26",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,6 +22,7 @@ export class MapOverlayManager {
22
22
  RenderRegions(regionLocations: any[], properties: any, farmLocations: any[], icon: any): void;
23
23
  RenderBackgroundFields(locations: any[], properties: any): void;
24
24
  RenderSAAdministrative(saAdministrativeJson: any[], selectedSAProvince: number, selectedSADM: number, selectedSALM: number, selectedSAWard: number, offsetX: number, offsetY: number, vMapWidth: number, isDashboard: boolean): void;
25
+ RenderSACadastral(saCadastralJson: any, offsetX: number, offsetY: number, vmWidth: number, isDashboard: boolean, fitBounds: boolean): void;
25
26
 
26
27
  // Shape Selection and Management
27
28
  selectShape(shapeId: string | number, selectedStyle: any, unselectedStyle: any): void;
@@ -2429,10 +2429,10 @@ export class MapOverlayManager {
2429
2429
 
2430
2430
  polygon = new google.maps.Polygon({
2431
2431
  paths: paths,
2432
- strokeColor: '#9ACD32',
2432
+ strokeColor: '#000000',
2433
2433
  strokeOpacity: 1,
2434
2434
  strokeWeight: 3,
2435
- fillColor: '#ffffff',
2435
+ fillColor: '#000000',
2436
2436
  fillOpacity: 0.3,
2437
2437
  zIndex: 10000,
2438
2438
  id: v.id,
@@ -2477,6 +2477,130 @@ export class MapOverlayManager {
2477
2477
  SAAdministrative_DrawSAAdministrative(saAdministrativeJson, selectedSAProvince, selectedSADM, selectedSALM, selectedSAWard, offsetX, offsetY, vMapWidth, isDashboard);
2478
2478
  }
2479
2479
 
2480
+ function SACadastral_DrawSACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
2481
+ mapListeners_clear();
2482
+ polygonListeners_clear();
2483
+ markerListeners_clear();
2484
+ fmarkers_clear();
2485
+ fPolies_clear();
2486
+
2487
+ var mdeListener = google.maps.event.addListener(map, 'dragend', function() {
2488
+ if(map.getZoom() >= 12 && map.getZoom() <= 17) {
2489
+ eventHandlers["ReloadCadastralData"]({
2490
+ type: 'SUCCESS',
2491
+ message: 'Reload cadastral data on dragend',
2492
+ code: 200,
2493
+ data: null
2494
+ });
2495
+
2496
+ } else {
2497
+ mapListeners_clear();
2498
+ fPolies_clear();
2499
+ }
2500
+ });
2501
+ mapListeners.push(mdeListener);
2502
+
2503
+ var mzcListener = google.maps.event.addListener(map, 'zoom_changed', function() {
2504
+ if(map.getZoom() >= 12 && map.getZoom() <= 17) {
2505
+ eventHandlers["ReloadCadastralData"]({
2506
+ type: 'SUCCESS',
2507
+ message: 'Reload cadastral data on zoom changed',
2508
+ code: 200,
2509
+ data: null
2510
+ });
2511
+ } else {
2512
+ mapListeners_clear();
2513
+ fPolies_clear();
2514
+ }
2515
+ });
2516
+ mapListeners.push(mzcListener);
2517
+
2518
+ Display_SACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard);
2519
+ }
2520
+
2521
+ function Display_SACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
2522
+
2523
+ var parentFarmsJson = saCadastralJson.parentFarms;
2524
+ var farmPortionsJson = saCadastralJson.farmPortions;
2525
+ var ervenJson = saCadastralJson.erven;
2526
+
2527
+ if(parentFarmsJson.length > 0) {
2528
+ parentFarmsJson.forEach(function(v) {
2529
+ if(fitBounds) {
2530
+ bounds = new google.maps.LatLngBounds();
2531
+ }
2532
+
2533
+ var geojson = JSON.parse(v.geojson,true);
2534
+
2535
+ if(geojson.type == 'Polygon') {
2536
+
2537
+ var paths = [];
2538
+ var path = [];
2539
+
2540
+ geojson.coordinates[0].forEach(function(c,ci) {
2541
+ path.push(new google.maps.LatLng(c[1],c[0]));
2542
+ if(fitBounds) {
2543
+ bounds.extend(new google.maps.LatLng(c[1],c[0]));
2544
+ }
2545
+ });
2546
+ paths.push(path);
2547
+
2548
+ } else if(geojson.type == 'MultiPolygon') {
2549
+ var paths = [];
2550
+ geojson.coordinates.forEach(function(p,pi) {
2551
+ var path = [];
2552
+ p[0].forEach(function(c,ci) {
2553
+ path.push(new google.maps.LatLng(c[1],c[0]));
2554
+ if(fitBounds) {
2555
+ bounds.extend(new google.maps.LatLng(c[1],c[0]));
2556
+ }
2557
+ });
2558
+ paths.push(path);
2559
+ });
2560
+ }
2561
+
2562
+ var carea = v.geomarea/10000;
2563
+
2564
+ var fpoly = new google.maps.Polygon({
2565
+ map: map,
2566
+ paths: paths,
2567
+ strokeWeight: 5,
2568
+ strokeColor: '#000000',
2569
+ strokeOpacity: 1,
2570
+ fillColor: 'transparent',
2571
+ fillOpacity: 1,
2572
+ id: v.id,
2573
+ name: v.name,
2574
+ farm: '',
2575
+ //lpi: v.lpi,
2576
+ area: carea.toFixed(2),
2577
+ zIndex: 10001,
2578
+ });
2579
+
2580
+ if(fitBounds) {
2581
+ map.fitBounds(bounds);
2582
+ }
2583
+ fpolies.push(fpoly);
2584
+ });
2585
+
2586
+ }
2587
+
2588
+
2589
+ /*
2590
+ if(type == 'pf') {
2591
+ addListeners(pfpolies, type);
2592
+ } else if(type == 'fp') {
2593
+ addListeners(fppolies, type);
2594
+ } else if(type == 'er') {
2595
+ addListeners(erpolies, type);
2596
+ }
2597
+ */
2598
+
2599
+ }
2600
+
2601
+ _this.RenderSACadastral = function (saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds) {
2602
+ SACadastral_DrawSACadastral(saCadastralJson, offsetX, offsetY, vmWidth, isDashboard, fitBounds);
2603
+ }
2480
2604
 
2481
2605
  _this.NDVI_AddOverlay_DEA = function (locationJson, ndviTileURL, validGMTiles, eosLocationCropperRefId, eosViewId, spinnerURL, spinnerLat, spinnerLon, paletteId, colorMapTypeIdValue, isFullView, onComplete) {
2482
2606