LoginSignup
1
0

More than 3 years have passed since last update.

GoogleMapAPIでマーカーに数値を表示する方法

Last updated at Posted at 2020-09-24

GoogleMapAPIでマーカーに数値を表示する方法

結論

google.maps.Markerのインスタンスを作成する際に、label: に値を入れてあげる。
その際には文字列でないと、デフォルトのマーカーが表示される。

  new google.maps.Marker({
    position: { lat: 12.97, lng: 77.59 },
    label: '1',
    map: map,
  });

感想

ネットで探しても探し方の問題か、あまり良い記事がなかったので公式リファレンスをみたら一発だった。
今後は公式リファレンスを見る!(Google翻訳で問題なくみれるレベルでした)
https://developers.google.com/maps/documentation/javascript/examples/marker-labels?hl=ja#maps_marker_labels-css

1
0
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
1
0