The Address Geocoder plugin lets you attach coordinates to your posts, pages, and custom post types.
使用地址地理编码器插件,您可以将坐标附加到帖子,页面和自定义帖子类型中。
On your edit screens, simply enter an address into the metabox and hit “Geocode”.
在编辑屏幕上,只需在metabox中输入一个地址,然后点击“ Geocode”即可。 p>
This plugin uses Google Maps API v3 to translate an address to lat/lng coordinates.
此插件使用Google Maps API v3将地址转换为经/纬度坐标。
A Google Maps API key is required.
需要Google Maps API密钥。 p>
Fequently Asked Questions
常见问题 h3>
How do I retrieve the coordinates?
如何获取坐标? h4>
Access your data in the loop using the following functions, with the post ID passed as a parameter.
使用以下函数在循环中访问数据,并将帖子ID作为参数传递。
For the full coordinates (in brackets):
对于完整坐标(在方括号中): p>
ID ); <?php echo get_geocode_latlng($ post-> ID); ?>
?>
code> pre>
For the Latitude:
对于纬度: p>
ID ); <?php echo get_geocode_lat($ post-> ID); ?>
?>
code> pre>
For the Longitude:
对于经度: p>
ID ); <?php echo get_geocode_lng($ post-> ID); ?>
?>
code> pre>
For the Address:
地址: p>
ID ); <?php echo get_geocode_address($ post-> ID); ?>
?>
code> pre>