Page 2 of 6

adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Mon Jun 17, 2013 9:03 am
by ciccio

thanks Marina,
you have been very helpfull, I testes your code and it is fine.
but just another question:

how can i add markers on map without working with localStorage.
what should i use to map the rest response instead of the localStorage variable list_coordinate?

I tried to add

var marker;
for (var i = 0, j = coordinate.length; i < j; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng( coordinate.latitudine, coordinate.longitudine ),
map: Appery("googlemap_2").gmap
});}

on service Success event but it doesn't work


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Mon Jun 17, 2013 10:57 am
by Maryna Brodina

Hello! If you want to do it without working with localStorage, but add markers on service success - then you don't need additional steps to get data from localStorage.
codevar list_coordinate = localStorage&#46;getItem('list_coordinate');
var obj = JSON&#46;parse(list_coordinate);/code - all data is transmitted to variable "data", so you can use this variable:
codevar coordsArray = data&#46;coordinate;
var marker;
for (var i = 0, j = coordsArray&#46;length; i < j; i++) {
marker = new google&#46;maps&#46;Marker({
position: new google&#46;maps&#46;LatLng( coordsArray&#46;latitudine, coordsArray&#46;longitudine ),
map: Appery("map_name")&#46;gmap
});
}/code


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Mon Jun 17, 2013 11:11 am
by ciccio

thanks Marina you are great,
I added another topic to solve a problem with multiple-location-points markers and info window.
thanks


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Tue Aug 06, 2013 5:22 pm
by Willie Sims

Hey Marina, Your last scripts, I know I need to rename the mapname, but do I need to do anything with the data.coordinate
I tried your code and I get errors saying that data wasn't declared


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Tue Aug 06, 2013 5:46 pm
by Oleg Danchenkov

Variable "data" is a parameter of Success event function of service.
If you want to use this code in other event, you should define and initialise this variable


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Wed Mar 05, 2014 12:36 pm
by laura6372139

Hi;

I have a problem. I don't get it to work.

I have this db:
Image

Then:

Image

But doesn't work!

Can I help me!

thanks


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Wed Mar 05, 2014 3:42 pm
by Nikita

Hi,

Success event comes earlier than data is transferred by mapping to localStorage.
You should remove mapping to localStorage and instead of first three lines of your code use this one:
var coordsArray = data;
Service response's data (coordinates in mapping) are available in data variable


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Wed Mar 05, 2014 4:11 pm
by laura6372139

Thanks Nikita


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Sat May 10, 2014 10:04 am
by romo

hi Tommy B. i hv same problem with u. but still stuck! data lat/lng in DB to add multi marker to map. how u solve it.


adding-multiple-location-points-on-google-map-with-appery-io-backend-services

Posted: Sat May 10, 2014 3:36 pm
by Evgene Karachevtsev

Hello romo,

There is the solution of this problem on this page. Have you tried it? Or could you please specify what kind or problem do you have?