Skip to content

メッシュコードから緯度経度に変換するライブラリ

License

Notifications You must be signed in to change notification settings

kj3104/meshcode2latlng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meshcode2latlng

npm version

Installation

client side

<script type="text/javascript" src="./lib/meshcode2latlng.js"></script>
<script type="text/javascript">
  var loc = meshcode2latlng.first(5339);
//  loc => { south: 35.333333333333336,
//          west: 139,
//          north: 36.00000000000001,
//          east: 140 }
</script>

server side

npm install meshcode2latlngでインストールをします。

const meshcode2latlng = require('meshcode2latlng');
var loc = meshcode2latlng.first(5339);
//  loc => { south: 35.333333333333336,
//          west: 139,
//          north: 36.00000000000001,
//          east: 140 }

Description

メッシュコードから緯度経度に変換するライブラリです。(世界測地系 WGS84)

Demo of Google maps api

1次メッシュ

1st

var location =  meshcode2latlng.first(5339);
new google.maps.Rectangle({
  strokeColor: '#ff0000',
  fillColor: '#ff0000',
  map: map,
  bounds: {
    north: location.north,
    south: location.south,
    west: location.west,
    east: location.east
  }
});

2次メッシュ

2nd

var location =  meshcode2latlng.second(533946);
new google.maps.Rectangle({
  strokeColor: '#ff0000',
  fillColor: '#ff0000',
  map: map,
  bounds: {
    north: location.north,
    south: location.south,
    west: location.west,
    east: location.east
  }
});

3次メッシュ

3rd

var location =  meshcode2latlng.third(53394611);
new google.maps.Rectangle({
  strokeColor: '#ff0000',
  fillColor: '#ff0000',
  map: map,
  bounds: {
    north: location.north,
    south: location.south,
    west: location.west,
    east: location.east
  }
});

1/2メッシュ

1/2

var location =  meshcode2latlng.half(533946113);
new google.maps.Rectangle({
  strokeColor: '#ff0000',
  fillColor: '#ff0000',
  map: map,
  bounds: {
    north: location.north,
    south: location.south,
    west: location.west,
    east: location.east
  }
});

1/4メッシュ

1/4

var location =  meshcode2latlng.quater(5339461132);
new google.maps.Rectangle({
  strokeColor: '#ff0000',
  fillColor: '#ff0000',
  map: map,
  bounds: {
    north: location.north,
    south: location.south,
    west: location.west,
    east: location.east
  }
});

Licence

MIT

Author

luca3104

About

メッシュコードから緯度経度に変換するライブラリ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published