Google地图:通过地址显示地图 [英] Google Maps : Show Map Via Address
本文介绍了Google地图:通过地址显示地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var _map = new GMap2($ get(gmap)) );
var _latLng =新GLatLng(lat,lng);
_map.setCenter(_latLng,11);
_map.addControl(new GLargeMapControl());
_map.addControl(new GMapTypeControl());
var _icon =新的GIcon(G_DEFAULT_ICON);
var marker = new GMarker(_latLng);
_map.addOverlay(marker);
但是我没有GeoCode for Some Address。
如何显示仅通过地址显示地图。 使用 /reference.html#Geocoderrel =nofollow noreferrer> GeoCoder
首先将地址转换为经度和纬度,然后使用它。
I have this Code To show map on a page
var _map = new GMap2($get("gmap"));
var _latLng = new GLatLng(lat, lng);
_map.setCenter(_latLng, 11);
_map.addControl(new GLargeMapControl());
_map.addControl(new GMapTypeControl());
var _icon = new GIcon(G_DEFAULT_ICON);
var marker = new GMarker(_latLng);
_map.addOverlay(marker);
But I do Not have GeoCode for Some Address. How can I show Map via Address Only.
解决方案
You use the GeoCoder
to get the address into latitude and longitude first, and then use that.
Here's an example of how to geocode an address.
这篇关于Google地图:通过地址显示地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文