<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>
npm install meshcode2latlng
でインストールをします。
const meshcode2latlng = require('meshcode2latlng');
var loc = meshcode2latlng.first(5339);
// loc => { south: 35.333333333333336,
// west: 139,
// north: 36.00000000000001,
// east: 140 }
メッシュコードから緯度経度に変換するライブラリです。(世界測地系 WGS84)
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
}
});
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
}
});
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
}
});
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
}
});
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
}
});