Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BeHub-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dominik Rosiek
BeHub-web
Commits
f13a61d7
Commit
f13a61d7
authored
Nov 22, 2015
by
Dominik Rosiek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
map with all beacons
parent
db4f59c4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
18 deletions
+74
-18
map,js
BeHub/Hub/static/js/map,js
+0
-0
map.js
BeHub/Hub/static/js/map.js
+60
-0
maps.html
BeHub/Hub/templates/user_panel/content/maps.html
+9
-14
base.html
BeHub/Hub/templates/user_panel/default/base.html
+5
-4
No files found.
BeHub/Hub/static/js/map,js
deleted
100644 → 0
View file @
db4f59c4
BeHub/Hub/static/js/map.js
0 → 100644
View file @
f13a61d7
var
Map
=
(
function
(){
this
.
init
();
var
myLatLng
;
var
markers
;
var
map
;
})
Map
.
prototype
.
init
=
function
(){
var
self
=
this
;
this
.
myLatLng
=
{
lat
:
50.049765
,
lng
:
19.946762
};
this
.
map
=
new
google
.
maps
.
Map
(
document
.
getElementById
(
'map'
),
{
zoom
:
4
,
center
:
self
.
myLatLng
});
this
.
markers
=
[];
this
.
getAllBeacons
();
}
Map
.
prototype
.
addMarker
=
function
(
data
){
var
self
=
this
;
var
color
=
data
.
color
||
"FE7569"
;
var
longitude
=
parseFloat
(
data
.
longitude
);
var
latitude
=
parseFloat
(
data
.
latitude
);
var
image
=
new
google
.
maps
.
MarkerImage
(
"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|"
+
color
,
new
google
.
maps
.
Size
(
21
,
34
),
new
google
.
maps
.
Point
(
0
,
0
),
new
google
.
maps
.
Point
(
10
,
34
));
var
marker
=
new
google
.
maps
.
Marker
({
position
:
{
lat
:
latitude
,
lng
:
longitude
},
map
:
self
.
map
,
icon
:
image
,
title
:
data
.
title
,
beacon
:
data
.
beacon
}).
addListener
(
'click'
,
function
()
{
self
.
showInfo
(
this
)
})
self
.
markers
.
push
(
marker
)
}
Map
.
prototype
.
getAllBeacons
=
function
(){
var
self
=
this
;
$
.
getJSON
(
"/api/beacons"
,
function
(
data
){
for
(
var
i
=
0
;
i
<
data
.
count
;
i
++
){
self
.
addMarker
({
color
:
"FE7569"
,
longitude
:
data
.
results
[
i
].
longitude
,
latitude
:
data
.
results
[
i
].
latitude
,
title
:
[
data
.
results
[
i
].
uuid
,
"("
,
data
.
results
[
i
].
name
,
")"
].
join
(
""
),
beacon
:
data
.
results
[
i
]
});
}
})
}
Map
.
prototype
.
showInfo
=
function
(
marker
){
alert
(
'marker klikniety'
+
marker
.
beacon
.
uuid
)
}
\ No newline at end of file
BeHub/Hub/templates/user_panel/content/maps.html
View file @
f13a61d7
{% extends 'user_panel/default/base.html' %}
<div
id=
"map"
style=
"height: 100%;"
>
{% block content %}
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<h2>
Mapa
</h2>
</div>
</div>
</div>
</div>
<script>
{% endblock content %}
var
map
;
\ No newline at end of file
$
(
document
).
ready
(
function
(){
map
=
new
Map
();
});
</script>
<script
async
defer
src=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyAaYyVEcLFqwKP_VnzfRSIMkWWWrLtMiGQ&signed_in=true&callback=initMap"
></script>
\ No newline at end of file
BeHub/Hub/templates/user_panel/default/base.html
View file @
f13a61d7
...
@@ -13,6 +13,11 @@
...
@@ -13,6 +13,11 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/left_bar.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/left_bar.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/font-awesome.min.css' %}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'css/font-awesome.min.css' %}"
/>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script
src=
"{% static 'js/bootstrap.min.js' %}"
></script>
<title>
Activy
</title>
<title>
Activy
</title>
</head>
</head>
...
@@ -27,10 +32,6 @@
...
@@ -27,10 +32,6 @@
</div>
</div>
{% include 'user_panel/default/footer.html' %}
{% include 'user_panel/default/footer.html' %}
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script
src=
"{% static 'js/bootstrap.min.js' %}"
></script>
<script
src=
"{% static 'js/hobby_detail.js' %}"
></script>
<script
src=
"{% static 'js/hobby_detail.js' %}"
></script>
<script
src=
"{% static 'js/map.js' %}"
></script>
<script
src=
"{% static 'js/map.js' %}"
></script>
<
<
...
...
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