Improved www.ttss.krakow.pl
Jacek Kowalski
2020-03-13 b470addbdbc536f1da04e004282ba73d15f78ae1
map.js
@@ -82,12 +82,12 @@
   this._element = element;
   this._element.classList.add('panel');
   
   this._hide = addParaWithText(this._element, '▶');
   this._hide = addElementWithText(this._element, 'a', '▶');
   this._hide.title = lang.action_collapse;
   this._hide.className = 'hide';
   this._hide.addEventListener('click', this.toggleExpanded.bind(this));
   
   this._close = addParaWithText(this._element, '×');
   this._close = addElementWithText(this._element, 'a', '×');
   this._close.title = lang.action_close;
   this._close.className = 'close';
   this._close.addEventListener('click', this.close.bind(this));
@@ -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({
@@ -674,7 +675,7 @@
      })}, 10);
   };
   showOnMapElement.addEventListener('click', showOnMapFunction);
   showOnMapElement.className = 'icon-pin addon-icon';
   showOnMapElement.className = 'icon icon-pin';
   showOnMapElement.title = lang.show_on_map;
   
   if(additional) {
@@ -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({
@@ -963,9 +962,15 @@
   
   document.getElementById('find').addEventListener('click', find.open.bind(find, panel));
   
   var hidpi = ol.has.DEVICE_PIXEL_RATIO > 1;
   var layers = [
      new ol.layer.Tile({
         source: new ol.source.OSM(),
         source: new ol.source.XYZ({
            attributions: [ol.source.OSM.ATTRIBUTION],
            url: 'http://10.12.16.142:8080/tiles/mapnik_'+(hidpi ? 'x2' : 'x1')+'/webmercator_'+(hidpi ? 'x2' : 'x1')+'/{z}/{x}/{y}.png',
            maxZoom: 19,
            tilePixelRatio: (hidpi ? 2 : 1),
         }),
      }),
      route_layer,
      geolocation_layer,