GitXplorerGitXplorer
l

flutter_hkgrid80_wgs84_converter

public
1 stars
2 forks
0 issues

Commits

List of commits on branch master.
Verified
f01fff5c327237abccc89ca6b415658013b359d5

Merge pull request #2 from thc282/master

llowkahonn committed 10 days ago
Verified
18e8dc63fd92052444aaa05553feade617da99c9

fix null checking after sdk update

tthc282 committed 13 days ago
Verified
1f6b81a9cb4b849b9ab5ab5e3914bc9def56324e

Merge pull request #1 from thc282/master

llowkahonn committed 13 days ago
Verified
16f44efa7bf1f1de5dd1503ad8da03414111beed

Update README.md

tthc282 committed 13 days ago
Verified
c1fd893fcd17aa12fe006328f7c1b1ec614e085f

Update pubspec.yaml

tthc282 committed 13 days ago
Unverified
6cf026e9fa8a1200e173464437394a0c404a1bf5

update readme

kko12345 committed 5 years ago

README

The README file for this repository.

flutter_hkgrid80_wgs84_converter

This package allows you to convert WGS 84 Latitude and Longitude to Hong Kong Grid 1980 Easting and Northing.

Usage

Add this repository to pubspec.yaml.

Example:

dependencies:
    flutter:
        sdk: flutter
    flutter_hkgrid80_wgs84_converter:
        git: 
            url: https://github.com/lowkahonn/flutter_hkgrid80_wgs84_converter.git
            ref: master

Import package:flutter_hkgrid80_wgs84_converter/flutter_hkgrid80_wgs84_converter.dart, and use Converter.convert to convert between the two systems.

Note: This converter is up to 1e-5% error.

Example:

import 'package:flutter_hkgrid80_wgs84_converter/flutter_hkgrid80_wgs84_converter.dart';

final coordinate = new Coordinate(
    x: 834349.252, 
    y: 815894.556,
    lat: 22.281927, 
    lng: 114.158256
);

// from x y to lat long
Coordinate latLng = Converter.convert.gridToLatLng(coordinate);
print(latLng.lat.toString()); // 22.281930012478536 
print(latLng.lng.toString()); // 114.15824821181121

// from lat long to x y
Coordinate xy = Converter.convert.latLngToGrid(coordinate);
print(xy.x.toString()); // 834350.1488648592
print(xy.y.toString()); // 815894.2762260285