Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
whats-open-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
whats-open-web
Commits
fb893ca0
Commit
fb893ca0
authored
Sep 17, 2018
by
Mattias J Duffy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more map performance improvements
parent
c650e27f
Pipeline
#2897
passed with stages
in 1 minute and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
src/components/FacilitiesMap.js
src/components/FacilitiesMap.js
+11
-7
No files found.
src/components/FacilitiesMap.js
View file @
fb893ca0
...
...
@@ -42,12 +42,17 @@ class FacilitiesMap extends React.Component {
this
.
state
=
{
maxBounds
:
getMaxBounds
(
campusRegion
),
campusRegion
:
campusRegion
,
center
:
facilityLocationExists
?
facility
.
facility_location
.
coordinate_location
.
coordinates
:
getCenterOfCampusRegion
(
campusRegion
),
zoom
:
facilityLocationExists
?
[
17
]
:
[
0
],
zoom
:
[
17
],
fitBoundsOptions
:
{},
facilityLocations
:
[],
selectedLocation
:
null
selectedLocation
:
null
,
isLoaded
:
false
};
setTimeout
(()
=>
{
this
.
setState
({
center
:
facilityLocationExists
?
facility
.
facility_location
.
coordinate_location
.
coordinates
:
getCenterOfCampusRegion
(
campusRegion
)
});
},
500
);
}
componentWillReceiveProps
(
nextProps
)
{
...
...
@@ -72,7 +77,7 @@ class FacilitiesMap extends React.Component {
maxBounds
:
getMaxBounds
(
campusRegion
),
campusRegion
:
campusRegion
,
center
:
facilityLocationExists
?
facility
.
facility_location
.
coordinate_location
.
coordinates
:
getCenterOfCampusRegion
(
campusRegion
),
zoom
:
facilityLocationExists
?
[
17
]
:
[
0
]
zoom
:
[
17
]
});
};
...
...
@@ -108,14 +113,13 @@ class FacilitiesMap extends React.Component {
this
.
setState
({
selectedLocation
:
oldSelectedLocation
!==
location
?
location
:
null
,
center
:
location
&&
location
.
location
.
coordinate_location
.
coordinates
,
zoom
:
oldSelectedLocation
!==
location
?
[
17
]
:
oldZoom
zoom
:
[
17
]
});
}
render
()
{
const
{
interactive
=
true
}
=
this
.
props
;
const
{
maxBounds
,
fitBoundsOptions
,
facilityLocations
,
selectedLocation
,
center
,
zoom
}
=
this
.
state
;
return
(
<
this
.
Map
onStyleLoad
=
{(
map
)
=>
{
...
...
@@ -130,7 +134,7 @@ class FacilitiesMap extends React.Component {
}}
animationOptions
=
{{
animate
:
true
,
duration
:
1
50
0
duration
:
1
25
0
}}
style
=
"
mapbox://styles/mduffy8/cjbcdxi3v73hp2spiyhxbkjde
"
movingMethod
=
"
easeTo
"
...
...
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