Page 1 of 1

I need to show my locagtions on the google maps. But the locations is not showed

Posted: Wed Aug 28, 2013 6:18 pm
by Fabio Calabrot

Hi friends,
The google maps is load. The center position is ok, but my points of location is not showed on the screem. My database has five colmuns and ond a "location" column.
Image


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Wed Aug 28, 2013 6:44 pm
by Anton Artyukh5836028

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).


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Wed Aug 28, 2013 7:46 pm
by Fabio Calabrot

Image

friend


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Wed Aug 28, 2013 9:15 pm
by Anton Artyukh5836028

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.


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Wed Aug 28, 2013 10:22 pm
by Fabio Calabrot

Image

Friend we need that you show me the steps, because this system is very important for me.


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Thu Aug 29, 2013 6:01 am
by Maryna Brodina

Hello! See Max reply here https://getsatisfaction.com/apperyio/... - let's continue this post if you have any questions.


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Thu Aug 29, 2013 12:43 pm
by Maryna Brodina

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&#46;aLocations&#46;length; i++) {
maxLatitude = locationHelper&#46;aLocations[0] > maxLatitude ? locationHelper&#46;aLocations[0] : maxLatitude;
minLatitude = locationHelper&#46;aLocations[0] < minLatitude ? locationHelper&#46;aLocations[0] : minLatitude;
maxLongitude = locationHelper&#46;aLocations[1] > maxLongitude ? locationHelper&#46;aLocations[1] : maxLongitude;
minLongitude = locationHelper&#46;aLocations[1] < minLongitude ? locationHelper&#46;aLocations[1] : minLongitude;
}
var map = new google&#46;maps&#46;Map(document&#46;getElementsByName("multiGoogleMap")[0], {
zoom: 5,
center: new google&#46;maps&#46;LatLng((maxLatitude + minLatitude) &#47; 2, (maxLongitude + minLongitude) &#47; 2),
mapTypeId: google&#46;maps&#46;MapTypeId&#46;ROADMAP
});
var marker, i;
for (i = 0; i < locationHelper&#46;aLocations&#46;length; i++) {
marker = new google&#46;maps&#46;Marker({
position: new google&#46;maps&#46;LatLng(locationHelper&#46;aLocations[0], locationHelper&#46;aLocations[1]),
map: map
});
}
var map = Appery('multiGoogleMap');
map&#46;refresh();/code

4) On locationList sevice Success event add code:
codefor(var i = 0, dataLen = data&#46;length; i < dataLen; i++){
getCoords&#46;execute({
'data' : {
'address' : data[i]&#46;location,
'sensor' : true
}
});
}/code


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Thu Aug 29, 2013 6:50 pm
by Fabio Calabrot

Working fine!! very good.
Could you help me using info window?
I need to show information on the infowindow.
best regards.


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Thu Aug 29, 2013 7:38 pm
by Fabio Calabrot

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.


I need to show my locagtions on the google maps. But the locations is not showed

Posted: Thu Aug 29, 2013 9:02 pm
by Alena Prykhodko

Hello, Fabio!

Please look at a similar question, the next post https://getsatisfaction.com/apperyio/...

And could you please clarify your second question?