I would like to build a custom page showing GPS track on map. This should work base no mqtt GPS data from smartphone (send by owntracks app).
I find interesting plugin http://leafletjs.com/ and try to use it base of example
Code: Select all
<html>
<head>
<title>A Leaflet map!</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<style>
#map{ height: 180% }
</style>
</head>
<body>
<div id="map"></div>
<script>
// initialize the map
var map = L.map('map').setView([42.35, -71.08], 13);
// load a tile layer
L.tileLayer('http://tiles.mapc.org/basemap/{z}/{x}/{y}.png',
{
attribution: 'Tiles by <a href="http://mapc.org">MAPC</a>, Data by <a href="http://mass.gov/mgis">MassGIS</a>',
maxZoom: 17,
minZoom: 9
}).addTo(map);
</script>
</body>
</html>
http://192.168.10.95:8181/map.html
or
http://192.168.10.95:8181/tempaltes/map.html
but not from domoticz user menu.
I received :
Code: Select all
ReferenceError: L is not defined
var map = L.map('map').setView([42.35, -71.08], 13);
I noticed that leafletjs link and script in this way are not call, so I moved both to www/index.html.
After that i don't received this error but map is not displayed.
Is there somebody to help me solve this problem?