Hello,
Please try to debug your App: http://docs.appery.io/documentation/d...
Is there any errors in browser console?
Hello,
Please try to debug your App: http://docs.appery.io/documentation/d...
Is there any errors in browser console?
Hi Maryna,
Seems pretty straightforward to add the click event to the listener... but I'm obviously missing something.
[quote:]
var list_location = localStorage.getItem('farmProducts_storage');
var obj = JSON.parse(list_location);
var coordsArray = obj;
marker = [];
markers = [];
var image = 'http://www.buylocalnb.ca/markers/farm...';
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,
icon: image,
});
// Adds a marker to the map and push to the array.
markers.push(marker);
Code: Select all
var infowindow = new google.maps.InfoWindow({content: ('[b]' + coordsArray[i].business_name + '[/b]
' + coordsArray.hours_season + '
' + coordsArray.combinedAddress )});
Code: Select all
$(document).off("click", "#content").on("click", "#content", function(){
Appery.navigateTo("farm_products_details");
});
Code: Select all
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);
google.maps.event.addListener(map, 'bounds_changed', function() {
});
[/quote]
Hi Igor,
I've followed along with this as well. I'm not seeing any errors or notifications in the console. Clicking the infowindow has no action. Thoughts? I tried this outside the loop as well, but perhaps not properly.
[quote:]
var list_location = localStorage.getItem('farmProducts_storage');
var obj = JSON.parse(list_location);
var coordsArray = obj;
marker = [];
markers = [];
var image = 'http://www.buylocalnb.ca/markers/farm...';
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,
icon: image,
});
// Adds a marker to the map and push to the array.
markers.push(marker);
Code: Select all
var infowindow = new google.maps.InfoWindow({content: ('[b]' + coordsArray[i].business_name + '[/b]
' + coordsArray.hours_season + '
' + coordsArray.combinedAddress )});
Code: Select all
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(Appery("Gmap").gmap,marker);
});
$(document).off("click", "#content").on("click", "#content", function(){
Appery.navigateTo("farm_products_details");
setTimeout(initialize, 1000);
});
};
for (var i = 0, j = coordsArray.length; i < j; i++)
CreateMarker(coordsArray, i);
google.maps.event.addListener(map, 'bounds_changed', function() {
});
[/quote]
Hello,
Please use simple google example: https://developers.google.com/maps/do...
Just change predocument.getElementById('map')/pre to preApperyio("googlemap_name").gmap/pre here googlemap_name- name of the map component
map = new Appery("Gmap").options.mapElement.gmap('get', 'map');
Hmm, don't I already have it though??
Sergiy, I see that perhaps the question was misunderstood. My infowindow appears just fine. However I want to create a click event within the opened infowindow box.
Have you check google's example? What event do you use for running this JS?