Use bing maps to load map for incoming job orders. #221

This commit is contained in:
Korina Cordero 2019-06-17 04:56:48 +00:00
parent 6e682889c7
commit e37406d6d1
2 changed files with 22 additions and 19 deletions

View file

@ -87,9 +87,9 @@ services:
$password: "%env(REDIS_CLIENT_PASSWORD)%" $password: "%env(REDIS_CLIENT_PASSWORD)%"
$env_flag: "dev" $env_flag: "dev"
App\Service\GoogleMapManager: ~ App\Service\BingMapManager: ~
App\Service\MapManagerInterface: "@App\\Service\\GoogleMapManager" App\Service\MapManagerInterface: "@App\\Service\\BingMapManager"
Catalyst\APIBundle\Security\APIKeyUserProvider: Catalyst\APIBundle\Security\APIKeyUserProvider:
arguments: arguments:

View file

@ -1,14 +1,18 @@
<script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap&key={{ bingmaps_api_key|raw }}' async defer></script> <script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap&key={{ bingmaps_api_key|raw }}' async defer></script>
<script> <script>
$(function() { var form_in_process = false;
var form_in_process = false; var searchManager;
var searchManager; var pin;
var pin; var map;
var map = new Microsoft.Maps.Map('#m_gmap', {
function GetMap()
{
map = new Microsoft.Maps.Map('#m_gmap', {
center: new Microsoft.Maps.Location(14.6091, 121.0223), center: new Microsoft.Maps.Location(14.6091, 121.0223),
culture: 'fil-Latn'; culture: 'fil-Latn'
}; });
Microsoft.Maps.Events.addHandler(map, 'click', selectPoint); Microsoft.Maps.Events.addHandler(map, 'click', selectPoint);
function selectPoint(e) { function selectPoint(e) {
@ -27,18 +31,21 @@ $(function() {
map.entities.push(pin); map.entities.push(pin);
map.setCenter(location); map.setCenter(location);
// set value in hidden input // set value in hidden input
$('#map_lat').val(locTemp.latitude); $('#map_lat').val(locTemp.latitude);
$('#map_lng').val(locTemp.longitude); $('#map_lng').val(locTemp.longitude);
} }
map.setCenter(lat, lng); map.setCenter(lat, lng);
// set value in hidden input // set value in hidden input
$('#map_lat').val(lat); $('#map_lat').val(lat);
$('#map_lng').val(lng); $('#map_lng').val(lng);
} }
}
$(function() {
function geocodeQuery(query) { function geocodeQuery(query) {
var searchRequest = { var searchRequest = {
@ -133,15 +140,11 @@ $(function() {
var hub_dest = new Microsoft.Maps.Location({{ hub.hub.getCoordinates.getLatitude }}, var hub_dest = new Microsoft.Maps.Location({{ hub.hub.getCoordinates.getLatitude }},
{{ hub.hub.getCoordinates.getLongitude }}); {{ hub.hub.getCoordinates.getLongitude }});
hmap.entities.push(new Microsoft.Maps.Pushpin(hub_dest, { hmap.entities.push(new Microsoft.Maps.Pushpin(hub_dest, {
title: "{{ hub.hub.getName }}",
text: "{{ hub.hub.getName }}",
icon: '/assets/images/icon-outlet.png'
}) })
); );
hmap.addMarker({
lat: {{ hub.hub.getCoordinates.getLatitude }},
lng: {{ hub.hub.getCoordinates.getLongitude }},
title: "{{ hub.hub.getName }}",
content: "{{ hub.hub.getName }}",
icon: '/assets/images/icon-outlet.png'
});
{% endfor %} {% endfor %}
{% endif %} {% endif %}