Please check Google Maps API. The Marker should have a property where you can set its title/name.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Please check Google Maps API. The Marker should have a property where you can set its title/name.
I checked Google map Api and i found "title" property but i can not send it to (ConvertAddr" service parameters) to get place in the loop in this code:
function log2(m) {
return ((Math.log(m)) / (Math.log(2)));
};
for (var k in value.geometry) {
if (locationHelper.checkLocation(k)) {
locationHelper.aLocations.push([value.geometry.location.lat, value.geometry.location.lng]);
}
}
var maxLatitude = -90,
minLatitude = 90,
maxLongitude = -180,
minLongitude = 180;
for (i = 0; i < locationHelper.aLocations.length; i++) {
maxLatitude = locationHelper.aLocations[0] maxLatitude ? locationHelper.aLocations[0] : maxLatitude;
minLatitude = locationHelper.aLocations[0] < minLatitude ? locationHelper.aLocations[0] : minLatitude;
maxLongitude = locationHelper.aLocations[1] maxLongitude ? locationHelper.aLocations[1] : maxLongitude;
minLongitude = locationHelper.aLocations[1] < minLongitude ? locationHelper.aLocations[1] : minLongitude;
}
var map = new google.maps.Map(document.getElementsByName("multiGoogleMap")[0], {
zoom: 5,
center: new google.maps.LatLng((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var marker, i;
for (i = 0; i < locationHelper.aLocations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locationHelper.aLocations[0], locationHelper.aLocations[1]),
map: map
});
}
I'm not 100% sure I understand the question. You need to have the title information inside the loop, where you create the marker.
Yes, Exactly
Hello,
You should create service which will return title from database. Save service responce into localStorage variable. After that you can use localStorage value as marker title value. Below doc should be helpful: http://docs.appery.io/documentation/r...
The title already comes in the same "Locations_addresses_list_service" as in the following picture:
and this the code for locationList variable:
var map = Appery('multiGoogleMap');
var aLocations = new Array();
aLocations.push(value);
if (value) {
for (var i in value) {
if(i == 'location') {
getCoords.execute({
'data' : {
'address' : value.location,
'sensor' : true,
'title' : value.title
}
});
}
}
}
but I can not receive the "title" value in getCoords service
Hi Ayman.
I think you should use generic service for ConvertAddr service (instead of common REST service) and pass 'title' to this service.
https://getsatisfaction.com/apperyio/...