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'); $places = get_field('orte');
if($places){ if($places){
foreach ($places as $place){ 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; endwhile;
@ -89,6 +89,7 @@
for(var i = 0; i < places.length; i++){ for(var i = 0; i < places.length; i++){
var marker = new google.maps.Marker({ var marker = new google.maps.Marker({
position: {lat: parseFloat(places[i]['lat']), lng: parseFloat(places[i]['lng']) }, position: {lat: parseFloat(places[i]['lat']), lng: parseFloat(places[i]['lng']) },
title: places[i]['title'],
map: map map: map
}); });
marker.setVisible(true); marker.setVisible(true);