Skip to content

Commit

Permalink
upgrade OpenLayers to newer version to fix Safari display issues
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Aug 10, 2021
1 parent b6bae0f commit bf982cd
Show file tree
Hide file tree
Showing 73 changed files with 70 additions and 2,085 deletions.
2 changes: 1 addition & 1 deletion webui/GNSSTracking/GNSSTracking.bndlspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<manifest>
<name>macchina.io GNSS Tracking</name>
<symbolicName>io.macchina.webui.gnsstracking</symbolicName>
<version>1.0.0</version>
<version>1.1.0</version>
<vendor>Applied Informatics</vendor>
<copyright>(c) 2015-2021, Applied Informatics Software Engineering GmbH</copyright>
<lazyStart>false</lazyStart>
Expand Down
3 changes: 2 additions & 1 deletion webui/GNSSTracking/bundle/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<link rel="stylesheet" href="/css/macchina.css" type="text/css"/>
<link rel="stylesheet" href="/css/font-awesome.min.css" type="text/css"/>
<link rel="stylesheet" href="/macchina/gnss/css/styles.css" type="text/css"/>
<link rel="stylesheet" href="/openlayers/css/ol.css">
<link rel="icon" href="/images/favicon.ico">
<script type="text/javascript" src="/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/angular/angular.min.js"></script>
<script type="text/javascript" src="/macchina/gnss/js/app.js"></script>
<script type="text/javascript" src="/macchina/gnss/js/controllers.js"></script>
<script type="text/javascript" src="/openlayers/OpenLayers.js"></script>
<script type="text/javascript" src="/openlayers/js/ol.js"></script>
</head>
<body ng-controller="SessionCtrl">
<header>
Expand Down
83 changes: 53 additions & 30 deletions webui/GNSSTracking/bundle/webapp/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trackingControllers.controller('TrackingCtrl', ['$scope', '$http', '$interval',
available: false,
valid: false
};

$scope.map = null;

$scope.resizeMap = function() {
Expand All @@ -20,42 +20,65 @@ trackingControllers.controller('TrackingCtrl', ['$scope', '$http', '$interval',
$scope.map.updateSize();
}
}

$scope.resizeMap();

$scope.map = new OpenLayers.Map('mapview');
$scope.baseLayer = new OpenLayers.Layer.OSM();
$scope.map.addLayer($scope.baseLayer);
$scope.markers = new OpenLayers.Layer.Markers("Markers");
$scope.map.addLayer($scope.markers);
$scope.marker = null;
var initialPosition = new OpenLayers.LonLat(0, 0);
$scope.map.setCenter(initialPosition, 1);
$scope.map = new ol.Map({
target: 'mapview',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: ol.proj.fromLonLat([0.0, 0.0]),
zoom: 1
})
});

$scope.markers = null;

$scope.setPosition = function(position) {
var zoomIn = false;
if ($scope.markers)
{
$scope.map.removeLayer($scope.markers);
$scope.markers = null;
}
else
{
zoomIn = true;
}
const projPos = ol.proj.fromLonLat([position.longitude, position.latitude]);
$scope.markers = new ol.layer.Vector({
source: new ol.source.Vector({
features: [
new ol.Feature({
geometry: new ol.geom.Point(projPos)
})
]
}),
style: new ol.style.Style({
image: new ol.style.Icon({
anchor: [0.5, 1],
anchorXUnits: 'fraction',
anchorYUnits: 'fraction',
src: '/openlayers/img/marker.png'
})
})
})
$scope.map.addLayer($scope.markers);
$scope.map.getView().setCenter(projPos);
if (zoomIn)
{
$scope.map.getView().setZoom(10);
}
};

$(window).resize(function() {
$scope.resizeMap();
});

$scope.setPosition = function(position) {
var olPosition = new OpenLayers.LonLat(position.longitude, position.latitude);
var wgs84Proj = new OpenLayers.Projection("EPSG:4326"); // WGS 1984
var mercatorProj = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator Projection
olPosition = olPosition.transform(wgs84Proj, mercatorProj);
var zoomIn = false;
if (!$scope.marker) zoomIn = true; // zoom in first time marker is set
if ($scope.marker)
{
$scope.markers.removeMarker($scope.marker);
$scope.marker = null;
}
if (zoomIn)
$scope.map.setCenter(olPosition, 10);
else
$scope.map.setCenter(olPosition);
$scope.marker = new OpenLayers.Marker(olPosition);
$scope.markers.addMarker($scope.marker);
};

$http.get('/macchina/gnss/tracking.jss').success(function(data) {
$scope.trackingData = data;
if (data.valid)
Expand Down
2 changes: 1 addition & 1 deletion webui/OpenLayers/OpenLayers.bndlspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<manifest>
<name>OpenLayers for macchina.io</name>
<symbolicName>io.macchina.webui.openlayers</symbolicName>
<version>2.13.1</version>
<version>6.4.3</version>
<vendor>Applied Informatics</vendor>
<copyright>(c) 2015-2021, Applied Informatics Software Engineering GmbH</copyright>
<lazyStart>false</lazyStart>
Expand Down
1,443 changes: 0 additions & 1,443 deletions webui/OpenLayers/bundle/openlayers/OpenLayers.js

This file was deleted.

2 changes: 2 additions & 0 deletions webui/OpenLayers/bundle/openlayers/css/ol.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webui/OpenLayers/bundle/openlayers/css/ol.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed webui/OpenLayers/bundle/openlayers/img/blank.gif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/east-mini.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/marker-blue.png
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/marker-gold.png
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/marker-green.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/north-mini.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/slider.png
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/south-mini.png
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/west-mini.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed webui/OpenLayers/bundle/openlayers/img/zoombar.png
Binary file not shown.
9 changes: 9 additions & 0 deletions webui/OpenLayers/bundle/openlayers/js/ol.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/OpenLayers/bundle/openlayers/js/ol.js.map

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions webui/OpenLayers/bundle/openlayers/theme/default/google.css

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions webui/OpenLayers/bundle/openlayers/theme/default/ie6-style.css

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading

0 comments on commit bf982cd

Please sign in to comment.