LoginSignup
3
2

More than 5 years have passed since last update.

Google Maps APIでGeoJSON編集機能を有効にする

Posted at
//Google Maps API 初期化
var map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: { lat: 36.322356, lng: 139.013057 },
    zoom: 5
});

map.data.setStyle({draggable: true, editable: true}); //ドラッグとエディットを有効にする
map.data.setControls(['Point', 'LineString', 'Polygon']); //エディットコントローラーを表示

地図上にエディットコントローラーが表示される
gmap_geojsoneditor.JPG

詳細
Google Maps APIにGeoJSONを編集する機能が付いたので、サクッとGeoJSONエディタ作ってみた。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2