Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
ddf901ed
Commit
ddf901ed
authored
8 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
refreshOverlayMarkers simplified to handle only optimization issues
parent
a328ead1
No related branches found
Branches containing commit
Tags
v12.0.0-alpha.1
Tags containing commit
1 merge request
!5
Frontend refactor
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend-js/src/main/js/map/CustomMap.js
+3
-43
3 additions, 43 deletions
frontend-js/src/main/js/map/CustomMap.js
with
3 additions
and
43 deletions
frontend-js/src/main/js/map/CustomMap.js
+
3
−
43
View file @
ddf901ed
...
...
@@ -497,37 +497,14 @@ CustomMap.prototype.refreshMarkers = function() {
CustomMap
.
prototype
.
refreshOverlayMarkers
=
function
(
overlay
)
{
logger
.
debug
(
"
Refresh overlay:
"
+
overlay
.
name
);
var
boundsArray
=
[];
boundsArray
[
this
.
getId
()]
=
new
google
.
maps
.
LatLngBounds
();
for
(
var
i
=
0
;
i
<
this
.
submaps
.
length
;
i
++
)
{
boundsArray
[
this
.
submaps
[
i
].
getId
()]
=
new
google
.
maps
.
LatLngBounds
();
}
var
updated
=
false
;
var
stillMissing
=
false
;
var
bounds
;
for
(
var
aliasKey
in
overlay
.
aliasMarkers
)
{
if
(
overlay
.
aliasMarkers
.
hasOwnProperty
(
aliasKey
)
&&
overlay
.
aliasMarkers
[
aliasKey
]
!==
undefined
&&
overlay
.
aliasMarkers
[
aliasKey
]
!==
null
)
{
var
alias
=
overlay
.
aliasMarkers
[
aliasKey
];
if
(
alias
.
getAliasData
()
===
null
||
alias
.
getAliasData
()
===
undefined
)
{
alias
.
getCustomMap
().
getModel
().
getAliasById
(
alias
.
getId
()).
then
(
function
(
aliasData
)
{
alias
.
setAliasData
(
aliasData
);
alias
.
init
();
alias
.
show
();
updated
=
true
;
bounds
=
alias
.
getBounds
();
boundsArray
[
alias
.
getCustomMap
().
getId
()].
extend
(
bounds
.
getNorthEast
());
});
}
else
{
bounds
=
alias
.
getBounds
();
if
(
!
this
.
isMarkerOptimization
())
{
alias
.
hide
();
alias
.
show
();
}
boundsArray
[
alias
.
getCustomMap
().
getId
()].
extend
(
bounds
.
getNorthEast
());
boundsArray
[
alias
.
getCustomMap
().
getId
()].
extend
(
bounds
.
getSouthWest
());
if
(
!
this
.
isMarkerOptimization
())
{
alias
.
hide
();
alias
.
show
();
}
}
}
...
...
@@ -540,12 +517,10 @@ CustomMap.prototype.refreshOverlayMarkers = function(overlay) {
// visualization is
// already there
// alias.update();
bounds
=
pointMarker
.
getBounds
();
if
(
!
this
.
isMarkerOptimization
())
{
pointMarker
.
hide
();
pointMarker
.
show
();
}
boundsArray
[
pointMarker
.
getCustomMap
().
getId
()].
extend
(
bounds
.
getNorthEast
());
}
}
...
...
@@ -556,25 +531,10 @@ CustomMap.prototype.refreshOverlayMarkers = function(overlay) {
if
(
!
reactionOverlay
.
isShown
())
{
reactionOverlay
.
show
();
}
bounds
=
reactionOverlay
.
getBounds
();
if
(
!
this
.
isMarkerOptimization
())
{
reactionOverlay
.
hide
();
reactionOverlay
.
show
();
}
boundsArray
[
reactionOverlay
.
getCustomMap
().
getId
()].
extend
(
bounds
.
getNorthEast
());
boundsArray
[
reactionOverlay
.
getCustomMap
().
getId
()].
extend
(
bounds
.
getSouthWest
());
}
}
if
(
!
stillMissing
&&
updated
&&
overlay
.
fitBounds
)
{
for
(
var
mapId
in
boundsArray
)
{
if
(
boundsArray
.
hasOwnProperty
(
mapId
))
{
var
map
=
this
.
getSubmodelById
(
mapId
).
getGoogleMap
();
bounds
=
boundsArray
[
mapId
];
if
(
map
!==
undefined
&&
!
bounds
.
isEmpty
())
{
map
.
fitBounds
(
bounds
);
}
}
}
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment