Art
Posts: 0
Joined: Mon Jul 23, 2012 9:05 pm

Multiple markers on a map from a REST request

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Multiple markers on a map from a REST request

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

Art
Posts: 0
Joined: Mon Jul 23, 2012 9:05 pm

Multiple markers on a map from a REST request

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Multiple markers on a map from a REST request

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

Art
Posts: 0
Joined: Mon Jul 23, 2012 9:05 pm

Multiple markers on a map from a REST request

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Multiple markers on a map from a REST request

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

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Multiple markers on a map from a REST request

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

Return to “Issues”