Hello, I am trying to expand on top of the Tutorial http://docs.appery.io/tutorials/addin...
What I am trying to do is create marker labels from the rest service, The API will let me add markers in either an address or longitude,latitude format this works fine
But I have not been able to figure out how to expand the code to also add labels to the markers so that on focus or on tap of the marker it will pull the description from multiple columns
I have three collection loaded for our different fuel stops each collection I have named universally so
Name:string would be the name of the truckstop (all collections have the same)
Highway:string would be the details of the highway and exit number
Phone:string
fax:string
and so on
I want to make sure I am following the proper steps
I have created a database service for each collection
The below code works up to a point, I think I will need to add code to push the information from the database into the info window, This is where I am lost
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 infowindow = new google.maps.InfoWindow({
content: "Name"
});
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
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker)
});
}
/code
The feed into this has a location and a Name the Name is what I want to show up in the info window but i dont know what to do next?
code
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
}
});
}
}
}
/code
http://appery.io/app/mobile-frame?src...