1.0.2 • Published 6 years ago
@fe-steven/google-maps-util v1.0.2
google-maps-util
Provides some functions with Google maps.
Core Functions
- converseLngLatToGoogleCoordinates
- getGoogleAddrFromArray
- getEachPolygonLngLatStr
- resetCenter
Usage
converseLngLatToGoogleCoordinates
const lngLats = 'lng,lat;lng,lat;lng,lat;';
const googleCoordinates = converseLngLatToGoogleCoordinates(lngLats);
// => [{lat: , lng: }, {lat: , lng: }, {lat: , lng: }, {lat: , lng: }]
getGoogleAddrFromArray
const addrs = ['France', 'Île-de-France', 'Paris' ];
const googleAddr = getGoogleAddrFromArray(addrs);
// => Paris,Île-de-France,France
getEachPolygonLngLatStr
const str = getEachPolygonLngLatStr(polygon);
// lng,lat;lng,lat;lng,lat;lng,lat;lng,lat;
resetCenter
调用谷歌地图的Geocoding Service查询地址的坐标,重新聚焦
resetCenter(map, address, zoom);