From 4c3092ac58603f7a6c58f0037b81b74f600b78bc Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 10 Jun 2019 07:56:22 +0000 Subject: [PATCH] Add methods to map managers to display a Bing map or a Google map for geofence. #221 --- src/Service/BingMapManager.php | 30 ++++++++++++++++++++++- src/Service/GoogleMapManager.php | 37 ++++++++++++++++++++++++++++- src/Service/MapManagerInterface.php | 9 ++----- templates/geofence/list.html.twig | 6 ++--- 4 files changed, 70 insertions(+), 12 deletions(-) diff --git a/src/Service/BingMapManager.php b/src/Service/BingMapManager.php index 8069e1ce..6b1145b3 100644 --- a/src/Service/BingMapManager.php +++ b/src/Service/BingMapManager.php @@ -4,7 +4,35 @@ namespace App\Service; class BingMapManager implements MapManagerInterface { - public function jsDisplayMap() + public function jsGeofence() { + + echo "" . "\n"; + echo "". "\n"; + } } diff --git a/src/Service/GoogleMapManager.php b/src/Service/GoogleMapManager.php index ac02d107..8b425654 100644 --- a/src/Service/GoogleMapManager.php +++ b/src/Service/GoogleMapManager.php @@ -2,6 +2,41 @@ namespace App\Service; -class GoogleMapManager +class GoogleMapManager implements MapManagerInterface { + public function jsGeofence() + { + echo "" . "\n"; + echo "" . "\n"; + echo "". "\n"; + } } diff --git a/src/Service/MapManagerInterface.php b/src/Service/MapManagerInterface.php index fdb9bb77..10934d7a 100644 --- a/src/Service/MapManagerInterface.php +++ b/src/Service/MapManagerInterface.php @@ -4,17 +4,12 @@ namespace App\Service; interface MapManagerInterface { - /* - * Return a map to be used to display location - * - */ - public function jsDisplayMap(); /* - * Return a map with polygons to show coverage areas + * Return javascript text with map and polygons to show coverage areas * */ - //public function jsGeofence(); + public function jsGeofence(); //public function jsJobOrderDetails(); diff --git a/templates/geofence/list.html.twig b/templates/geofence/list.html.twig index 3b9e7bba..341a627b 100644 --- a/templates/geofence/list.html.twig +++ b/templates/geofence/list.html.twig @@ -39,7 +39,7 @@
-
+
@@ -90,7 +90,7 @@ var polygons = new Array(); function GetMap() { - var map = new Microsoft.Maps.Map('#m_bingmap', { + var map = new Microsoft.Maps.Map('#m_geomap', { center: new Microsoft.Maps.Location(14.6091, 121.0223), mapTypeId: Microsoft.Maps.MapTypeId.road, zoom: 13 @@ -109,7 +109,7 @@ function GetMap() {% endfor %} var coveredarea = new Microsoft.Maps.Polygon(pointsArray, { - fillColor: "#FF0000", + fillColor: "#FF0000" }); map.entities.push(coveredarea);