diff options
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/map/BaseMap.js | 7 | ||||
-rw-r--r-- | web/app/view/map/MapMarkerController.js | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index 015cddd0..f973fb86 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -232,7 +232,12 @@ Ext.define('Traccar.view.map.BaseMap', { } } }, function () { + var projection; proj4.defs('BD-MC', '+proj=merc +lon_0=0 +units=m +ellps=clrk66 +no_defs'); proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'); - ol.proj.get('EPSG:3395').setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]); + ol.proj.proj4.register(proj4); + projection = ol.proj.get('EPSG:3395'); + if (projection) { + projection.setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]); + } }); diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index bf6b0d49..28f1226e 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -217,7 +217,7 @@ Ext.define('Traccar.view.map.MapMarkerController', { projection = mapView.getProjection(); center = ol.proj.fromLonLat([position.get('longitude'), position.get('latitude')]); pointResolution = ol.proj.getPointResolution(projection, mapView.getResolution(), center); - radius = position.get('accuracy') / ol.proj.METERS_PER_UNIT.m * mapView.getResolution() / pointResolution; + radius = position.get('accuracy') / ol.proj.Units.METERS_PER_UNIT.m * mapView.getResolution() / pointResolution; if (feature) { feature.getGeometry().setCenter(center); |