回答編集履歴
1
情報の追加。
answer
CHANGED
@@ -1,1 +1,27 @@
|
|
1
|
-
console.log(feature.properties) としてデベロッパーツールで確認してみては。
|
1
|
+
console.log(feature.properties) としてデベロッパーツールで確認してみては。
|
2
|
+
|
3
|
+
|
4
|
+
---
|
5
|
+
|
6
|
+
**追記:**
|
7
|
+
|
8
|
+
下記矢印の先に全角の空白が。
|
9
|
+
|
10
|
+
```js
|
11
|
+
//CSVの「icon」が「icon1」ならば「img1.png」
|
12
|
+
// ↓
|
13
|
+
if (feature.properties.icon === 'icon1') {
|
14
|
+
var icon = L.icon({
|
15
|
+
iconUrl: 'img1.png',
|
16
|
+
iconSize: [20,20]
|
17
|
+
});
|
18
|
+
}
|
19
|
+
//CSVの「icon」が「icon2」ならば「img2.png」
|
20
|
+
// ↓ ↓
|
21
|
+
if (feature.properties.icon === 'icon2') {
|
22
|
+
var icon = L.icon({
|
23
|
+
iconUrl: 'img2.png',
|
24
|
+
iconSize: [20,20]
|
25
|
+
});
|
26
|
+
}
|
27
|
+
```
|