メッシュコードから緯度経度に変換するライブラリ
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
LICENSE
README.md
index.js
package.json

README.md

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