Hi,
I try to place markers on a google map component.
if get my respons from the service i get my database entries in a list on my creen and then i run this JS on event succes but it don't place the markers what i am doing wrong here? this service calls the server code from this geolocation tutorial https://devcenter.appery.io/tutorials...
and this is the java script what i use
//Were "multiGoogleMap" is map component name.
var map = Appery("google_map").options.mapElement.gmap('get', 'map');
var CreateMarker = function(data){
console.log("add marker with coordinates = " + data.lat + " = " + data.long);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(data.lat, data.long),
map: map
});
};
for (var i = 0; i < data.length; i++)
//In this function you should to pass latitude, longitude and text to display in infowindow.
CreateMarker({lat: data.Lat, long: data.Lng, location: data.salary});
this is the mapping what i use
If i use this code for a other service that llist all items from the database then on the event succes it places the markers