Page 3 of 3

Infowindow

Posted: Sat Jan 11, 2014 3:20 pm
by Igor

Hello,

Please try to debug your App: http://docs.appery.io/documentation/d...
Is there any errors in browser console?


Infowindow

Posted: Thu Sep 03, 2015 5:28 pm
by Blair Cox

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]


Infowindow

Posted: Thu Sep 03, 2015 5:36 pm
by Blair Cox

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]


Infowindow

Posted: Wed Sep 09, 2015 7:35 pm
by Serhii Kulibaba

Hello,

Please use simple google example: https://developers.google.com/maps/do...
Just change predocument&#46;getElementById('map')/pre to preApperyio("googlemap_name")&#46;gmap/pre here googlemap_name- name of the map component


Infowindow

Posted: Wed Sep 09, 2015 7:52 pm
by Blair Cox

map = new Appery("Gmap").options.mapElement.gmap('get', 'map');

Hmm, don't I already have it though??


Infowindow

Posted: Thu Sep 10, 2015 11:58 am
by Blair Cox

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.


Infowindow

Posted: Mon Sep 14, 2015 7:17 am
by Serhii Kulibaba

Have you check google's example? What event do you use for running this JS?