Skip to content

Provides Google Maps data conversion and other features.

Notifications You must be signed in to change notification settings

stevenwujianpeng/google-maps-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Provides Google Maps data conversion and other features.

Resources

Stars

Watchers

Forks

Packages

No packages published