开发者

how to fix the precision for lat/lng?

with the v2 version we can fix the precision with toFixed example: poin开发者_C百科t.y.toFixed(4) how can we do with the v3 version ?


toFixed is just JavaScript function - not from Google Maps API.

In API v3 you can do that during LatLng creating:

var latitude  = -25.363882;
var longitude = 131.044922;
var latLng = new google.maps.LatLng(latitude.toFixed(4), longitude.toFixed(4));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜