|
|
|
@ -45,6 +45,13 @@ TABS.gps.initialize = function (callback) {
|
|
|
|
|
mapLayer = new ol.source.OSM();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#center_button").click(function(){
|
|
|
|
|
let lat = GPS_DATA.lat / 10000000;
|
|
|
|
|
let lon = GPS_DATA.lon / 10000000;
|
|
|
|
|
let center = ol.proj.fromLonLat([lon, lat]);
|
|
|
|
|
mapView.setCenter(center);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
mapHandler = new ol.Map({
|
|
|
|
|
target: document.getElementById('gps-map'),
|
|
|
|
|
layers: [
|
|
|
|
@ -107,6 +114,8 @@ TABS.gps.initialize = function (callback) {
|
|
|
|
|
//Update map
|
|
|
|
|
if (GPS_DATA.fix >= 2) {
|
|
|
|
|
|
|
|
|
|
let center = ol.proj.fromLonLat([lon, lat]);
|
|
|
|
|
|
|
|
|
|
if (!cursorInitialized) {
|
|
|
|
|
cursorInitialized = true;
|
|
|
|
|
|
|
|
|
@ -135,12 +144,13 @@ TABS.gps.initialize = function (callback) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
mapHandler.addLayer(currentPositionLayer);
|
|
|
|
|
|
|
|
|
|
mapView.setCenter(center);
|
|
|
|
|
mapView.setZoom(14);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let center = ol.proj.fromLonLat([lon, lat]);
|
|
|
|
|
mapView.setCenter(center);
|
|
|
|
|
mapView.setZoom(14);
|
|
|
|
|
iconGeometry.setCoordinates(center);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|