-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.php
More file actions
31 lines (29 loc) · 1007 Bytes
/
Copy pathfunctions.php
File metadata and controls
31 lines (29 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/*
* Shortcode: [ga_map width='500' height='220' long='54.578592' lat='-5.934293' zoom='14']
*
*/
add_shortcode('ga_map', 'ga_map_shortcode');
function ga_map_shortcode($atts){
$width = intval($atts['width']);
$height = intval($atts['height']);
$long = trim($atts['long']);
$lat = trim($atts['lat']);
$zoom = trim($atts['zoom']);
return '
<div id="bhmap" style="clear:both; display:block; margin:20px 0; width:'.$width.'px; height:'.$height.'px;"></div>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById(\'bhmap\'), {
zoom: '.$zoom.',
center: new google.maps.LatLng('.$long.','.$lat.'),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
marker = new google.maps.Marker({
position: new google.maps.LatLng('.$long.','.$lat.', '.$zoom.'),
map: map
});
</script>
';
}
?>