teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

地図描画コード追記

2020/09/07 22:45

投稿

DaisukeMori
DaisukeMori

スコア229

title CHANGED
File without changes
body CHANGED
@@ -32,7 +32,23 @@
32
32
  // 省略
33
33
 
34
34
  return(<>
35
+ <ReactMapGL
36
+ {...viewport}
37
+ onViewportChange={nextViewport => setViewport(nextViewport)}
38
+ mapboxApiAccessToken={MAPBOX_ACCESS_TOKEN}
39
+ mapStyle="mapbox://styles/mapbox/light-v9"
40
+ >
41
+ <Marker latitude={ 35.650184 } longitude={ 139.701269 }>
42
+ <a
43
+ href={`http://maps.google.com/maps?q=35.650184,139.701269`}
44
+ rel="noopener noreferrer"
45
+ target="_blank"
46
+ >
47
+ <img src={LocateIcon} alt="locate" />
48
+ </a>
49
+ </Marker>
50
+ </ReactMapGL>
35
- {/* jsx省略 */}
51
+ {/* 省略 */}
36
52
  </>);
37
53
  );
38
54
  }