latlngconv 0.1.0 copy "latlngconv: ^0.1.0" to clipboard
latlngconv: ^0.1.0 copied to clipboard

A package to convert latitude and longitude between WGS84, GCJ-02, BD-09 and WebMercator

example/example.dart

import "package:latlngconv/latlngconv.dart";


void main() {
    //location from gps provider inside china. 
    LatLng wgs = new LatLng(31.1695941, 121.3926092);

    //check if the location is out of china(this method gives a rectangle check. but the actual )
    bool isThisPointOutOfChina = OutofChina(wgs);

    //convert wgs84 to gcj02
    LatLng gcj = LatLngConvert(wgs, LatLngType.WGS84, LatLngType.GCJ02);

    //convert from gcj02 to bd09. (the bd09 could be used by baidumap)
    LatLng bd09 = LatLngConvert(gcj, LatLngType.GCJ02, LatLngType.BD09);

    //convert from wgs to bd09
    LatLng bd09_2 = LatLngConvert(wgs, LatLngType.WGS84, LatLngType.BD09);

    //convert from wgs84 to webmercator
    LatLng mercator = LatLngConvert(wgs, LatLngType.WGS84, LatLngType.WebMercator);
}
1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A package to convert latitude and longitude between WGS84, GCJ-02, BD-09 and WebMercator

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, latlong

More

Packages that depend on latlngconv