关键词:
<?php
$locations = get_field('locations_repeater', 'option');
if( $locations && !empty($locations) )
$location_array = array();
$map_settings = get_field('map_settings', 'option');
$map_marker = !empty($map_settings['map_marker_icon']) ? $map_settings['map_marker_icon']['sizes']['medium'] : get_template_directory_uri() . '/images/map-marker-default.png';
foreach ( $locations as $location )
$location_array[] = array(
'lat' => $location['loc_lat'],
'lon' => $location['loc_long'],
'icon' => $map_marker,
'info' => array(
'name' => $location['location_name'],
'address' => $location['street_address'],
'city' => $location['city'],
'state' => $location['state'],
'zip' => $location['zip'],
// 'directions' => 'https://www.google.com/maps/'
),
);
$markers = json_encode($location_array);
$map_center = !empty($map_settings['map_focus_lat_long']) ? $map_settings['map_focus_lat_long'] : $location_array[0]['lat'] . ',' . $location_array[0]['lon'];
$map_zoom = !empty($map_settings['map_zoom_level']) ? $map_settings['map_zoom_level'] : '15';
$map_styles = !empty($map_settings['map_styles']) ? $map_settings['map_styles'] : '["featureType":"administrative","elementType":"all","stylers":["saturation":"-100"],"featureType":"administrative.province","elementType":"all","stylers":["visibility":"off"],"featureType":"landscape","elementType":"all","stylers":["saturation":-100,"lightness":65,"visibility":"on"],"featureType":"poi","elementType":"all","stylers":["saturation":-100,"lightness":"50","visibility":"simplified"],"featureType":"road","elementType":"all","stylers":["saturation":"-100"],"featureType":"road.highway","elementType":"all","stylers":["visibility":"simplified"],"featureType":"road.highway","elementType":"geometry.fill","stylers":["color":"#ce0707"],"featureType":"road.highway","elementType":"geometry.stroke","stylers":["color":"#010000"],"featureType":"road.highway","elementType":"labels.text","stylers":["color":"#ffffff"],"featureType":"road.highway","elementType":"labels.text.fill","stylers":["color":"#ffffff"],"featureType":"road.highway","elementType":"labels.text.stroke","stylers":["color":"#000000","weight":"1.48"],"featureType":"road.arterial","elementType":"all","stylers":["lightness":"30"],"featureType":"road.arterial","elementType":"geometry.fill","stylers":["color":"#cc0f0f"],"featureType":"road.arterial","elementType":"labels.text","stylers":["color":"#ffffff"],"featureType":"road.arterial","elementType":"labels.text.stroke","stylers":["color":"#000000"],"featureType":"road.local","elementType":"all","stylers":["lightness":"40"],"featureType":"road.local","elementType":"geometry.fill","stylers":["color":"#ebd6d6"],"featureType":"transit","elementType":"all","stylers":["saturation":-100,"visibility":"simplified"],"featureType":"water","elementType":"geometry","stylers":["hue":"#ffff00","lightness":-25,"saturation":-97],"featureType":"water","elementType":"labels","stylers":["lightness":-25,"saturation":-100]]';
echo do_shortcode('[googlemap
width="100%"
height="300px"
zoom="' . $map_zoom . '"
center="' . $map_center . '"
markers="$markers"
snazzy="$map_styles"
]');
?>
php谷歌地图短代码(代码片段)
查看详情
php基本的谷歌地图(代码片段)
查看详情
php地址到谷歌地图链接(代码片段)
查看详情
php谷歌地址自动填写重力表单列表字段中的地图(代码片段)
查看详情
text谷歌地图-时髦的地图(代码片段)
查看详情
javascript谷歌地图(代码片段)
查看详情
html谷歌地图(代码片段)
查看详情
html谷歌地图(代码片段)
查看详情
html谷歌地图(代码片段)
查看详情
javascript谷歌地图(代码片段)
查看详情
javascript谷歌地图(代码片段)
查看详情
htmlacf谷歌地图(代码片段)
查看详情
flutter从谷歌地图获取坐标(代码片段)
我使用包google_maps_flutter在我的应用程序中使用谷歌地图。我的问题是如何设置一个监听器,当我按下地图以显示这个地方的协调时显示。我在文档中找不到任何内容。我发现唯一的东西是controllerMap,我用来设置标记监听器,它... 查看详情
javascript谷歌地图滚动(代码片段)
查看详情
javascriptjquery做谷歌地图!(代码片段)
查看详情
javascript谷歌地图类(代码片段)
查看详情
html谷歌地图+导航(代码片段)
查看详情
javascript谷歌地图文字(代码片段)
查看详情