latlngconv 0.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 71

latlngconv

A Flutter package to convert latitude and longitude between WGS84, GCJ-02, BD-09, Web Mercator

  • 有偏移需要修正的地图: 百度地图、高德地图、搜狗地图、搜搜地图、谷歌地图(国内服务器)
  • 不需要修正的地图: 天地图、谷歌地球、谷歌卫星地图(国外服务器)、必应卫星地图和OpenStreetMap地图等

Basic usage #

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

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

//they are expect to nearly equal
// wgs == wgs2

Features and bugs #

Please file feature requests and bugs at the issue tracker.

License #

Copyright 2015 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

[0.0.1] - 2018/12/27.

  • first release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  latlngconv: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:latlngconv/latlngconv.dart';
  
Version Uploaded Documentation Archive
0.1.0 Dec 28, 2018 Go to the documentation of latlngconv 0.1.0 Download latlngconv 0.1.0 archive
0.0.1 Dec 27, 2018 Go to the documentation of latlngconv 0.0.1 Download latlngconv 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
95
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on May 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.16
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/latlngconv.dart. (-4.89 points)

Analysis of lib/latlngconv.dart reported 10 hints, including:

line 71 col 6: Name non-constant identifiers using lowerCamelCase.

line 80 col 1: This function has a return type of 'LatLng', but doesn't end with a return statement.

line 80 col 8: Name non-constant identifiers using lowerCamelCase.

line 94 col 8: Name non-constant identifiers using lowerCamelCase.

line 106 col 8: Name non-constant identifiers using lowerCamelCase.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and latlngconv.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
latlong ^0.6.1 0.6.1
Transitive dependencies
ansicolor 1.0.2
collection 1.14.11
console_log_handler 1.1.6
intl 0.15.8
logging 0.11.3+2
meta 1.1.6 1.1.7
path 1.6.2
sky_engine 0.0.99
typed_data 1.1.6
validate 1.7.0
vector_math 2.0.8
Dev dependencies
flutter_test