Add title to marker

This commit is contained in:
Markus Ankenbrand 2017-02-19 18:14:15 +01:00
parent 2619b450b5
commit 23537782d6

View file

@ -69,7 +69,7 @@
$places = get_field('orte');
if($places){
foreach ($places as $place){
$locations[] = array_merge(array("post" => $post->ID), $place);
$locations[] = array_merge(array("post" => $post->ID, "title" => $post->post_title), $place);
}
}
endwhile;
@ -89,6 +89,7 @@
for(var i = 0; i < places.length; i++){
var marker = new google.maps.Marker({
position: {lat: parseFloat(places[i]['lat']), lng: parseFloat(places[i]['lng']) },
title: places[i]['title'],
map: map
});
marker.setVisible(true);