Hi Fabio,
How you setting points to map? May be screenshots with mapping, setting variables... Your current screenshot is cut off main info -- script names with line number (on the right end of error line).
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/
Hi Fabio,
How you setting points to map? May be screenshots with mapping, setting variables... Your current screenshot is cut off main info -- script names with line number (on the right end of error line).
Currently we have issue with running JS-code for mapped localStorage and JavaScript variables. You have to move your code to Success method of services. Full response available in data variable inside Success action.
Hello! See Max reply here https://getsatisfaction.com/apperyio/... - let's continue this post if you have any questions.
Hi,
1) delete mapping from responce to localStorage in both services;
2) on page Load event add the following code:
codefunction addMarkersAfterMapReady(mapName) {
if (!Appery(mapName).gmap) {
setTimeout(function () {addMarkersAfterMapReady(mapName)}, 100);
} else {
locationList.execute({});
}
}
addMarkersAfterMapReady("multiGoogleMap");/code
3) on getCoords service Success event add code:
codefunction log2(m) {
return ((Math.log(m)) / (Math.log(2)));
};
var value = data.results[0];
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
});
}
var map = Appery('multiGoogleMap');
map.refresh();/code
4) On locationList sevice Success event add code:
codefor(var i = 0, dataLen = data.length; i < dataLen; i++){
getCoords.execute({
'data' : {
'address' : data[i].location,
'sensor' : true
}
});
}/code
Working fine!! very good.
Could you help me using info window?
I need to show information on the infowindow.
best regards.
Working fine!! very good.
Could you help me using info window?
I need to show information on the infowindow.
best regards.
Info window and if is possible to add the service google maps directions on my map with all my points?
best regards.
Hello, Fabio!
Please look at a similar question, the next post https://getsatisfaction.com/apperyio/...
And could you please clarify your second question?