Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
Elphel
x3domlet
Commits
4cbbe6ce
Commit
4cbbe6ce
authored
Jun 03, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
leaflet plugin testing only
parent
42259844
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
0 deletions
+147
-0
map.css
js/map.css
+26
-0
map.js
js/map.js
+103
-0
map.html
map.html
+18
-0
No files found.
js/map.css
0 → 100644
View file @
4cbbe6ce
body
{
padding
:
0
;
margin
:
0
;
}
html
,
body
,
#leaflet_map
{
height
:
100vh
;
width
:
100vw
;
}
.measurementtooltip
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
padding
:
0px
3px
;
margin
:
14px
0px
0px
5px
;
font-weight
:
normal
;
border-radius
:
1px
;
}
.leaflet-tooltip-left.measurementtooltip
::before
{
border
:
0px
;
border-left-color
:
cyan
;
}
.leaflet-tooltip-right.measurementtooltip
::before
{
border
:
0px
;
border-right-color
:
cyan
;
}
\ No newline at end of file
js/map.js
0 → 100644
View file @
4cbbe6ce
/*
* TODO:
* *
*
*/
// http://stackoverflow.com/questions/9394190/leaflet-map-api-with-google-satellite-layer
// http://leafletjs.com/examples/extending/extending-1-classes.html
// - extend or include
$
(
function
(){
light_init
();
});
function
light_init
(){
$
.
ajax
({
url
:
"kml/test.kml"
,
success
:
function
(
data
){
var
marker
=
[
parseFloat
(
$
(
data
).
find
(
"Camera"
).
find
(
"latitude"
).
text
()),
parseFloat
(
$
(
data
).
find
(
"Camera"
).
find
(
"longitude"
).
text
())
];
var
heading
=
parseFloat
(
$
(
data
).
find
(
"Camera"
).
find
(
"longitude"
).
text
());
init_maps
(
marker
);
},
});
}
var
map
;
var
markers
=
Array
();
function
init_maps
(
center
){
var
elphelinc
=
center
;
//[40.7233861, -111.9328843];
// https: also suppported.
var
Esri_WorldImagery
=
L
.
tileLayer
(
'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'
,
{
maxZoom
:
21
,
attribution
:
'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
}
);
var
googleSat
=
L
.
tileLayer
(
'https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}'
,
{
maxZoom
:
21
,
attribution
:
'Many thanks to Google for our happy childhood'
,
subdomains
:[
'mt0'
,
'mt1'
,
'mt2'
,
'mt3'
],
}
);
var
OSMTiles
=
L
.
tileLayer
(
'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'
,
{
maxZoom
:
21
,
attribution
:
'Map data and images © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
}
);
map
=
L
.
map
(
'leaflet_map'
,{
layers
:[
googleSat
]
}).
setView
(
elphelinc
,
17
);
var
baseMaps
=
{
"Esri world imagery"
:
Esri_WorldImagery
,
"Google"
:
googleSat
,
"Open Street Map"
:
OSMTiles
};
//Esri_WorldImagery.addTo(map);
//googleSat.addTo(map);
//custom control:
//http://www.coffeegnome.net/control-button-leaflet/
L
.
control
.
layers
(
baseMaps
).
addTo
(
map
);
drawCamera
(
elphelinc
);
}
function
drawCamera
(
basepoint
){
var
circle
=
L
.
cameraViewMarker
(
basepoint
,
{
color
:
'#191'
,
fillColor
:
'#0f3'
,
fillOpacity
:
0.5
,
radius
:
10
,
heading
:
45
,
fov
:
45
*
Math
.
PI
/
180
,
id
:
"basecircle"
}).
addTo
(
map
);
}
map.html
0 → 100644
View file @
4cbbe6ce
<!DOCTYPE HTML>
<html
lang=
"en"
>
<head>
<title>
Ze Map
</title>
<meta
charset=
"utf-8"
/>
<script
type=
'text/javascript'
src=
'js/jquery-3.1.1.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet-src.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker.js'
></script>
<script
type=
'text/javascript'
src=
'js/leaflet/leaflet.camera-view-marker.measure.js'
></script>
<script
type=
'text/javascript'
src=
'js/map.js'
></script>
<link
rel=
'stylesheet'
type=
'text/css'
href=
'js/leaflet/leaflet.css'
></link>
<link
rel=
'stylesheet'
type=
'text/css'
href=
'js/index.css'
></link>
<link
rel=
'stylesheet'
type=
'text/css'
href=
'js/map.css'
></link>
</head>
<body>
<div
id=
"leaflet_map"
></div>
</body>
</html>
\ No newline at end of file
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