Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
85cfbe9c
Commit
85cfbe9c
authored
Sep 17, 2018
by
Mattias J Duffy
Browse files
dialog box now focusing on correct location
parent
fb893ca0
Changes
1
Show whitespace changes
Inline
Side-by-side
src/components/FacilitiesMap.js
View file @
85cfbe9c
...
...
@@ -26,10 +26,9 @@ class FacilitiesMap extends React.Component {
this
.
Map
=
ReactMapboxGl
({
accessToken
:
mapboxToken
,
interactive
:
interactiv
e
,
interactive
:
fals
e
,
attributionControl
:
false
});
const
facilityLocationExists
=
facility
&&
facility
.
facility_location
&&
facility
.
facility_location
.
campus_region
===
campusRegion
;
/**
...
...
@@ -43,17 +42,23 @@ class FacilitiesMap extends React.Component {
maxBounds
:
getMaxBounds
(
campusRegion
),
campusRegion
:
campusRegion
,
zoom
:
[
17
],
// center: facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion),
fitBoundsOptions
:
{},
facilityLocations
:
[],
selectedLocation
:
null
,
isLoaded
:
false
};
if
(
interactive
)
{
this
.
state
.
center
=
facilityLocationExists
?
facility
.
facility_location
.
coordinate_location
.
coordinates
:
getCenterOfCampusRegion
(
campusRegion
);
}
else
{
setTimeout
(()
=>
{
console
.
log
(
'
ran
'
);
this
.
setState
({
center
:
facilityLocationExists
?
facility
.
facility_location
.
coordinate_location
.
coordinates
:
getCenterOfCampusRegion
(
campusRegion
)
});
},
500
);
}
}
componentWillReceiveProps
(
nextProps
)
{
const
{
facility
,
facilities
}
=
nextProps
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment