Last active
June 29, 2016 12:33
-
-
Save commercial-hippie/8570069 to your computer and use it in GitHub Desktop.
Drupal - GMap - Render map with multiple markers in a template file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$latitude = '49.19258642226091'; | |
$longitude = '-123.17647933959961'; | |
$settings = array( | |
'id' => 'mymap', | |
'latitude' => $latitude, // center the map | |
'longitude' => $longitude, // on the marker | |
'zoom' => 10, | |
'width' => '100%', | |
'height' => '490px', | |
'type' => 'Satellite', | |
); | |
$settings['markers'] = array( | |
array( | |
'latitude' => $latitude, | |
'longitude' => $longitude, | |
// 'markername' => 'asd', | |
// 'offset' => 0, | |
), | |
array( | |
'latitude' => '49.59258642226091', | |
'longitude' => '-123.57647933959961', | |
// 'markername' => 'asd', | |
// 'offset' => 0, | |
) | |
); | |
// echo theme('gmap', array('#gmap_settings' => $settings)); | |
$element = array( | |
'#type' => 'gmap', | |
'#gmap_settings' => $settings, | |
); | |
echo drupal_render($element); |
Thank you very much for this snippet.
Andre see here http://www.passivhuscentrum.se/sites/all/modules/gmap/help/api.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
There is useful.
Could gmap marker tooltip and label by this way.
Thanks