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)%"
$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:
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>
$(function() {
var form_in_process = false;
var searchManager;
var pin;
var map = new Microsoft.Maps.Map('#m_gmap', {
var form_in_process = false;
var searchManager;
var pin;
var map;
function GetMap()
{
map = new Microsoft.Maps.Map('#m_gmap', {
center: new Microsoft.Maps.Location(14.6091, 121.0223),
culture: 'fil-Latn';
};
culture: 'fil-Latn'
});
Microsoft.Maps.Events.addHandler(map, 'click', selectPoint);
function selectPoint(e) {
@ -27,18 +31,21 @@ $(function() {
map.entities.push(pin);
map.setCenter(location);
// set value in hidden input
$('#map_lat').val(locTemp.latitude);
$('#map_lng').val(locTemp.longitude);
}
map.setCenter(lat, lng);
// set value in hidden input
$('#map_lat').val(lat);
$('#map_lng').val(lng);
}
}
$(function() {
function geocodeQuery(query) {
var searchRequest = {
@ -133,15 +140,11 @@ $(function() {
var hub_dest = new Microsoft.Maps.Location({{ hub.hub.getCoordinates.getLatitude }},
{{ hub.hub.getCoordinates.getLongitude }});
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 %}
{% endif %}