Skip to content

Commit fa9454a

Browse files
example added and LATITUDE replace global
1 parent 96c3eb9 commit fa9454a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

example/App.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export class App extends Component {
110110
height: 300,
111111
latitude: '37.773972',
112112
longitude: '-122.431297',
113+
staticURL: 'https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/pin-s-circle+FF0000(LONGITUDE,LATITUDE)/LONGITUDE,LATITUDE,ZOOM/270x200@2x?access_token=KEY',
113114
},
114115
onLoad: () => {
115116
console.log('Photo loaded');

src/LocationMessage/LocationMessage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export class LocationMessage extends Component {
1616
buildURL(url) {
1717
var center = this.props.data || {};
1818

19-
return url.replace('LATITUDE', center.latitude)
20-
.replace('LONGITUDE', center.longitude)
19+
return url.replace(/LATITUDE/g, center.latitude)
20+
.replace(/LONGITUDE/g, center.longitude)
2121
.replace('MARKER_COLOR', this.props.markerColor)
2222
.replace('ZOOM', this.props.zoom)
2323
.replace('KEY', this.props.apiKey);

0 commit comments

Comments
 (0)