mirror of
https://github.com/jlengrand/ShowMeYourBigSatellite.git
synced 2026-03-10 08:41:21 +00:00
Issue 5
Code is now fully functional with leaflet. Only missing element is the specialized marker that has to be created. Adds missiing images for leaflet Current map displayed is from mapbox, and can be updated to anything else (OSM, Google Maps, . . .). TODO : Customize marker
This commit is contained in:
@@ -3,6 +3,10 @@
|
|||||||
{
|
{
|
||||||
"selected_items":
|
"selected_items":
|
||||||
[
|
[
|
||||||
|
[
|
||||||
|
"center",
|
||||||
|
"centerStart"
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"m",
|
"m",
|
||||||
"mainCoord"
|
"mainCoord"
|
||||||
@@ -532,6 +536,9 @@
|
|||||||
},
|
},
|
||||||
"file_history":
|
"file_history":
|
||||||
[
|
[
|
||||||
|
"/home/jll/Documents/01_perso/14_ShowMeYourBigSatellite/.git/COMMIT_EDITMSG",
|
||||||
|
"/home/jll/Documents/01_perso/14_ShowMeYourBigSatellite/main.py",
|
||||||
|
"/home/jll/Documents/01_perso/14_ShowMeYourBigSatellite/.gitignore",
|
||||||
"/home/jll/dev/source/main/spacemetric/keystoneapi/build.xml",
|
"/home/jll/dev/source/main/spacemetric/keystoneapi/build.xml",
|
||||||
"/home/jll/dev/source/main/spacemetric/build.xml",
|
"/home/jll/dev/source/main/spacemetric/build.xml",
|
||||||
"/home/jll/dev/source/main/products/keystone/build.xml",
|
"/home/jll/dev/source/main/products/keystone/build.xml",
|
||||||
@@ -656,10 +663,7 @@
|
|||||||
"/home/jll/dev/source_git/main_zwolle/csd/db/build.properties",
|
"/home/jll/dev/source_git/main_zwolle/csd/db/build.properties",
|
||||||
"/opt/spacemetric/keystone/config/keystone.postgres",
|
"/opt/spacemetric/keystone/config/keystone.postgres",
|
||||||
"/home/jll/Desktop/WEB-INF/web.xml",
|
"/home/jll/Desktop/WEB-INF/web.xml",
|
||||||
"/home/jll/Documents/01_perso/19_jenkinsArduinoNotification/arduino/blink/Blink/Blink.ino",
|
"/home/jll/Documents/01_perso/19_jenkinsArduinoNotification/arduino/blink/Blink/Blink.ino"
|
||||||
"/home/jll/Documents/01_perso/18_blog/assets/fonts/icomoon.eot",
|
|
||||||
"/home/jll/Documents/01_perso/18_blog/assets/css/main.min.css",
|
|
||||||
"/home/jll/Documents/01_perso/18_blog/_posts/2012-08-31-ivolution-development-status-35.markdown"
|
|
||||||
],
|
],
|
||||||
"find":
|
"find":
|
||||||
{
|
{
|
||||||
@@ -873,7 +877,7 @@
|
|||||||
"cols":
|
"cols":
|
||||||
[
|
[
|
||||||
0.0,
|
0.0,
|
||||||
0.578905221254,
|
0.469688049537,
|
||||||
1.0
|
1.0
|
||||||
],
|
],
|
||||||
"rows":
|
"rows":
|
||||||
BIN
static/js/lib/images/layers-2x.png
Normal file
BIN
static/js/lib/images/layers-2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/js/lib/images/layers.png
Normal file
BIN
static/js/lib/images/layers.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/js/lib/images/marker-icon-2x.png
Normal file
BIN
static/js/lib/images/marker-icon-2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
BIN
static/js/lib/images/marker-icon.png
Normal file
BIN
static/js/lib/images/marker-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/js/lib/images/marker-shadow.png
Normal file
BIN
static/js/lib/images/marker-shadow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 797 B |
@@ -2,31 +2,36 @@ var map;
|
|||||||
var satMarker;
|
var satMarker;
|
||||||
var myLatLng;
|
var myLatLng;
|
||||||
|
|
||||||
function initializeGoogle() {
|
function initializeMap() {
|
||||||
|
|
||||||
var centerStart = new google.maps.LatLng(60, 16);
|
var centerStart = new L.latLng(60, 16);
|
||||||
|
|
||||||
var mapOptions = {
|
var mapOptions = {
|
||||||
zoom: 6,
|
zoom: 6,
|
||||||
center: centerStart,
|
center: centerStart
|
||||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
};
|
||||||
}
|
|
||||||
|
|
||||||
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
|
map = new L.map('map', mapOptions);
|
||||||
|
|
||||||
|
// adds an OpenStreetMap tile layer
|
||||||
|
var tileLayer = L.tileLayer('http://{s}.tiles.mapbox.com/v3/jlengrand.j49bad4d/{z}/{x}/{y}.png');
|
||||||
|
|
||||||
|
map.addLayer(tileLayer);
|
||||||
|
|
||||||
var image = 'images/satellite_64.png';
|
var image = 'images/satellite_64.png';
|
||||||
satMarker = new google.maps.Marker({
|
satMarker = new L.Marker(centerStart);
|
||||||
position: centerStart,
|
satMarker.addTo(map);
|
||||||
map: map,
|
//TODO: Custom marker
|
||||||
icon: image
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Gets the latest satellite position from the server
|
// Gets the latest satellite position from the server
|
||||||
function getPosition(){
|
function getPosition(){
|
||||||
$.getJSON("http://localhost:5000/get_coordinates",function(result){
|
$.getJSON("http://localhost:5000/get_coordinates",function(result){
|
||||||
var pos = new google.maps.LatLng(result.latitude, result.longitude);
|
var pos = new L.latLng(result.latitude, result.longitude);
|
||||||
satMarker.setPosition(pos);
|
satMarker.setLatLng(pos);
|
||||||
|
//FIXME: change
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +45,7 @@ function loopPosition(intervalSec){
|
|||||||
// Load the application once the DOM is ready, using `jQuery.ready`:
|
// Load the application once the DOM is ready, using `jQuery.ready`:
|
||||||
$(function(){
|
$(function(){
|
||||||
// Inits the map and the marker
|
// Inits the map and the marker
|
||||||
initializeGoogle();
|
initializeMap();
|
||||||
|
|
||||||
//Starts looping over the positions
|
//Starts looping over the positions
|
||||||
loopPosition(1);
|
loopPosition(1);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<style>
|
<style>
|
||||||
html, body, #map-canvas {
|
html, body, #map {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user