2
我有这样的代码,假设由经纬度将经度和纬度
public void initialize() {
geocoder = Geocoder.create();
myOptions = MapOptions.create();
myOptions.setZoom(18);
myOptions.setMapTypeId(MapTypeId.HYBRID);
myOptions.setMapMaker(true);
map = GoogleMap.create(
Document.get().getElementById("map_canvas"),myOptions);
GeocoderRequest request = GeocoderRequest.create();
request.setLocation(LatLng.create(lat,lng));
geocoder.geocode(request, new Callback() {
public void handle(JsArray<GeocoderResult> rslts, GeocoderStatus status)
{
if (status == GeocoderStatus.OK) {
location = rslts.get(0);
map.setCenter(location.getGeometry().getLocation());
marker = Marker.create();
marker.setMap(map);
marker.setPosition(location.getGeometry().getLocation());
}
}
});
当我与这些坐标(45.48592686713835
,-73.49009937672122
)测试,以放置标记标记 我只得到这是最近地址图标A.但我真正想要的是用绿色箭头显示的确切位置。
我这么想吗?
我做了你的建议,但现在我有这个奇怪的异常http://stackoverflow.com/questions/11284367/weird-exception-when-placing-a-marker-with-latlng – outellou