Page 2 of 2

Expand information when Google Maps Marker is clicked

Posted: Mon Aug 31, 2015 11:48 am
by Serhii Kulibaba

Hello Blair,

Do you use infowindows https://developers.google.com/maps/do... ?


Expand information when Google Maps Marker is clicked

Posted: Mon Aug 31, 2015 6:32 pm
by Blair Cox

Hi Sergiy - I actually got it working! But now having the issue of not being able to clear markers on each service success. It adds more markers. I'm trying to clear the markers array on each success service call - but no luck so far.

var list_location = localStorage.getItem('farmProducts_storage');
var obj = JSON.parse(list_location);
var coordsArray;
coordsArray.length = 0;
var coordsArray = obj;
//var marker = [];
//var image = 'files/views/assets/image/Map-Marker-Bubble-Azure-icon.png';
var image = 'http://chart.apis.google.com/chart?ch...';
var map = new Appery("Gmap").options.mapElement.gmap('get', 'map');

var CreateMarker = function(coordsArray, i){

Code: Select all

 var marker = new google.maps.Marker({  
     position: new google.maps.LatLng( coordsArray[i].lat, coordsArray[i].lng ),  
     title: coordsArray[i].business_name,  
     map: Appery("Gmap").gmap,  
 });  
 var infowindow = new google.maps.InfoWindow({content: ('[b]' + coordsArray[i].business_name + '[/b]

' + coordsArray.hours_season + '
' + coordsArray.combinedAddress )});
// var infowindow = new google.maps.InfoWindow({content: coordsArray.business_name});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(Appery("Gmap").gmap,marker);
});
};
for (var i = 0, j = coordsArray.length; i < j; i++)
CreateMarker(coordsArray, i);


Expand information when Google Maps Marker is clicked

Posted: Wed Sep 16, 2015 11:40 am
by Serhii Kulibaba

Please look this tutorial: https://developers.google.com/maps/do...