From 428023ba533cdcf2f3ec333142b5c173a27748bf Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sat, 06 Jul 2019 17:07:37 +0000 Subject: [PATCH] Use own tile server instead of OSM-provided one --- map.js | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/map.js b/map.js index 5752841..ace3baa 100644 --- a/map.js +++ b/map.js @@ -276,11 +276,12 @@ fill = '#922'; } - var image = '<svg xmlns="http://www.w3.org/2000/svg" height="30" width="20"><polygon points="10,0 20,23 0,23" style="fill:'+fill+';stroke:'+color_type+';stroke-width:3" /></svg>'; + var image = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="30"><polygon points="10,0 20,23 0,23" style="fill:'+fill+';stroke:'+color_type+';stroke-width:3"/></svg>'; vehicle.setStyle(new ol.style.Style({ image: new ol.style.Icon({ src: 'data:image/svg+xml;base64,' + btoa(image), + imgSize: [20,30], rotation: Math.PI * parseFloat(vehicle.get('heading') ? vehicle.get('heading') : 0) / 180.0, }), text: new ol.style.Text({ @@ -910,8 +911,6 @@ vehicles_last_update[type] = 0; }); - ol.style.IconImageCache.shared.setSize(512); - geolocation_feature = new ol.Feature({ name: '', style: new ol.style.Style({ @@ -965,7 +964,9 @@ var layers = [ new ol.layer.Tile({ - source: new ol.source.OSM(), + source: new ol.source.OSM({ + url: 'https://tiles.ttss.pl/{z}/{x}/{y}.png', + }), }), route_layer, geolocation_layer, -- Gitblit v1.9.1