You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if it's plugin issue or Google map. When i update map with new
coordinates, map zoom out. Following is the code
$( document ).on( "pageinit", "#page-3", function( event ) {
var newPoint = new google.maps.LatLng(current_lat, current_lon);
//google_map.gmap({ 'center': newPoint, 'zoom': 10 });
google_map.gmap({'center': newPoint, 'zoom': 12, scrollwheel:false, 'disableDefaultUI':true,'callback': function() {
var self = this;
//google_map.gmap('addControl', 'sidebar', google.maps.ControlPosition.LEFT_TOP);
self.set('getCurrentPosition', function() {
self.refresh();
self.getCurrentPosition( function(position, status) {
if ( status === 'OK' ) {
var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude)
self.get('map').panTo(latlng);
self.search({ 'location': latlng }, function(results, status) {
if ( status === 'OK' ) {
//$('#from').val(results[0].formatted_address);
}
});
} else {
alert('Unable to get current position');
}
});
});
}});
});
$( document ).on( "pageshow", "#page-3", function( event ) {
google_map.gmap('get', 'getCurrentPosition');
google_map.gmap('refresh');
});
//When click on detail page, it reload map with new coordinates
var from = new google.maps.LatLng(current_lat,current_lon);
var to = new google.maps.LatLng(coordinates[0], coordinates[1]);
google_map.gmap('displayDirections',{ 'origin': from, 'destination': to, 'travelMode': google.maps.DirectionsTravelMode.DRIVING }, { 'panel': document.getElementById('directions')}, function(response, status) {
google_map.gmap({'zoom': 12, scrollwheel:false});
});
Original issue reported on code.google.com by [email protected] on 5 Nov 2014 at 7:33
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 5 Nov 2014 at 7:33The text was updated successfully, but these errors were encountered: