Page 1 of 1

Multiple markers on a map from a REST request

Posted: Mon Jul 23, 2012 9:05 pm
by Art

I want to make a map with multiple markers.
But i want those markers to get their coordinates from a parse database.
I made a REST service with a Get on my DB and i linked the location key to a js in the data mapping panel.
Here's the js:

var location = new google.maps.LatLng(value);

var myOptions = {
zoom: 13,
center: new google.maps.LatLng(47.237957, 6.024005),
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map($('div[dsid="DivMap"]').get(0), myOptions);

var marker = new google.maps.Marker({
position: location,
map: map,
title:'Marker'
});

The map is working but not the markers..


Multiple markers on a map from a REST request

Posted: Mon Jul 23, 2012 10:53 pm
by maxkatz

Check if there are any errors in JavaScript console and everything is correct with Google Map API calls.


Multiple markers on a map from a REST request

Posted: Tue Jul 24, 2012 12:28 am
by Art

No error in the console, and the API call seems to be ok.
Again, the map work perfectly, the problem is there is no markers..


Multiple markers on a map from a REST request

Posted: Tue Jul 24, 2012 2:54 am
by maxkatz

Can you share the app link (make it public)?


Multiple markers on a map from a REST request

Posted: Tue Jul 24, 2012 2:55 pm
by Art

Yes, of course.
Here is the link : http://project.tiggzi.com/mobile-fram...

You can login with admin/admin, then go to "Lieux" then "carte", the map is here.


Multiple markers on a map from a REST request

Posted: Wed Jul 25, 2012 1:34 pm
by maxkatz

Your first line should be replaced with this:

code
var location_array = value.split(",");
var location = new google.maps.LatLng(parseFloat(location_array[0]),parseFloat(location_array[1]));
/code


Multiple markers on a map from a REST request

Posted: Thu Mar 05, 2015 9:13 pm
by EJLD

Hi There,
Just noticed that the markers on my google map don't show up anymore (it was still working perfect last week = meaning all markers were up there). have you changed anything again when upgrading the builder like last Sep ? pls advise I don't want to spend another 2 wks at figuring out what messed up my code again.
Thk you in advance
Eric