Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyBusMap
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Anton Sarukhanov
PyBusMap
Commits
c3891f44
Commit
c3891f44
authored
9 years ago
by
Anton Sarukhanov
Browse files
Options
Downloads
Patches
Plain Diff
Prevent glitches while moving the map. Also do a better job at removing stale markers.
parent
1e09f3a9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
static/css/map.css
+2
-0
2 additions, 0 deletions
static/css/map.css
static/js/map.js
+1
-2
1 addition, 2 deletions
static/js/map.js
with
3 additions
and
2 deletions
static/css/map.css
+
2
−
0
View file @
c3891f44
...
@@ -26,6 +26,7 @@ html, body {
...
@@ -26,6 +26,7 @@ html, body {
position
:
absolute
;
position
:
absolute
;
bottom
:
10px
;
bottom
:
10px
;
left
:
10px
;
left
:
10px
;
z-index
:
5000
;
}
}
#locate
a
{
#locate
a
{
text-decoration
:
none
;
text-decoration
:
none
;
...
@@ -75,6 +76,7 @@ html, body {
...
@@ -75,6 +76,7 @@ html, body {
border-left
:
1px
solid
#eee
;
border-left
:
1px
solid
#eee
;
border-top-left-radius
:
3px
;
border-top-left-radius
:
3px
;
color
:
#eee
;
color
:
#eee
;
z-index
:
5000
;
}
}
#map
.leaflet-control-zoom
,
#map
.leaflet-control-zoom
,
#map
.leaflet-control-zoom
a
{
#map
.leaflet-control-zoom
a
{
...
...
This diff is collapsed.
Click to expand it.
static/js/map.js
+
1
−
2
View file @
c3891f44
...
@@ -32,8 +32,6 @@ BusMap.Map = function(opts) {
...
@@ -32,8 +32,6 @@ BusMap.Map = function(opts) {
// Go to view requested by URL hash (if set)
// Go to view requested by URL hash (if set)
var
viewOk
=
that
.
setViewFromUrlHash
();
var
viewOk
=
that
.
setViewFromUrlHash
();
// And watch for updates
$
(
window
).
bind
(
'
hashchange
'
,
that
.
setViewFromUrlHash
);
if
(
!
viewOk
)
{
if
(
!
viewOk
)
{
// Restore the user's last view (if exists).
// Restore the user's last view (if exists).
...
@@ -208,6 +206,7 @@ BusMap.Map = function(opts) {
...
@@ -208,6 +206,7 @@ BusMap.Map = function(opts) {
for
(
v
in
that
.
vehicleMarkers
)
{
for
(
v
in
that
.
vehicleMarkers
)
{
var
min_updated
=
Date
.
now
()
-
(
that
.
vehicleMaxAge
*
1000
)
var
min_updated
=
Date
.
now
()
-
(
that
.
vehicleMaxAge
*
1000
)
if
(
that
.
vehicleMarkers
[
v
].
bm_updated
<
min_updated
)
{
if
(
that
.
vehicleMarkers
[
v
].
bm_updated
<
min_updated
)
{
that
.
leaflet
.
removeLayer
(
that
.
vehicleMarkers
[
v
]);
delete
that
.
vehicleMarkers
[
v
];
delete
that
.
vehicleMarkers
[
v
];
}
}
}
}
...
...
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