LoginSignup
1
0

More than 3 years have passed since last update.

Maplat Coreでマーカーの画像を変更する(レイヤー単位)

Posted at

Maplat Advent Calendar 9日目は、Maplat Coreでマーカーの画像を変更する方法(レイヤー単位)です。
今日の動くものはここで確認できます。 => CodeSandBox Maplat Advent Calendar day 9

今日の変更は簡単です。
昨日pois/poi.jsonに追加したiconおよびselected_iconの、設定場所を動かしてみましょう。
各POI単位の設定の下に追加していたのを、レイヤー設定の下での追加に動かしています。

pois/poi.json
{
  "main": {
    "pois": [
      {
        "id": "castle",
        "lat": 36.243881,
        "lng": 139.543517,
        "name": "館林城"
      },
      {
        "id": "shrine",
        "lat": 36.25163,
        "lng": 139.528562,
        "name": "愛宕神社"
      }
    ],
    "icon": "parts/blue_marker.png",
    "selected_icon": "parts/red_marker.png"
  }
}

これで、レイヤーに属するPOIピン全体のマーカー画像が切り替わります。

明日の話題は未定です。さて、そろそろ苦しくなってきた。何にしよう...。

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