allow multiple maps to be added on a page
This commit is contained in:
parent
264078d058
commit
6cbe62bad2
3 changed files with 82 additions and 87 deletions
|
@ -45,7 +45,7 @@ const makeOptionsForForm = (map, position, places = null) => {
|
|||
}
|
||||
|
||||
//position is output of navigator.geolocation call
|
||||
export default function addMapWithPlaces(position) {
|
||||
export default function addMapWithPlaces(div, position) {
|
||||
fetch('/places/near/' + position.coords.latitude + '/' + position.coords.longitude + '?u=' + position.coords.accuracy, {
|
||||
credentials: 'same-origin',
|
||||
method: 'get'
|
||||
|
@ -65,7 +65,7 @@ export default function addMapWithPlaces(position) {
|
|||
if (json.places.length > 0) {
|
||||
places = json.places;
|
||||
}
|
||||
let map = addMap(position, places);
|
||||
let map = addMap(div, position, places);
|
||||
//create a containting div for flexbox styling purposes
|
||||
let flexboxDiv = document.createElement('div');
|
||||
let options = makeOptionsForForm(map, position, places);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue