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

This forum contains topics that were moved from Get Satisfaction
ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

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

Post 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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

Post 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

ciccio
Posts: 0
Joined: Fri Jun 14, 2013 10:40 am

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

Post by ciccio »

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

Willie Sims
Posts: 0
Joined: Wed Jul 10, 2013 4:37 pm

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

Post 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

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

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

Post 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

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

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

Post 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

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

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

Post 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

laura6372139
Posts: 0
Joined: Wed Oct 30, 2013 11:54 am

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

Post by laura6372139 »

Thanks Nikita

romo
Posts: 0
Joined: Sat May 10, 2014 9:58 am

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

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

Post 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?

Post Reply