Sha256: 9bc3917269c556c767757461804db39907519bf0a98713683d86676f024adeba

Contents?: true

Size: 1.55 KB

Versions: 16

Compression:

Stored size: 1.55 KB

Contents

{% comment %}
This requires the page header to define
mapycz-api: mini-api   # normal api is OK too
gps:
  lat: ...
  long: ...
  zoom: # optional (default = 16)

Note: map is not inside accordion, as map tiles don't load at start due to accordion collapsing at start (zero height)
{% endcomment %}

{% if (page.mapycz_api) and (page.gps.lat) and (page.gps.long) %}
  {% assign gps_zoom = 16 %}

  {% if (page.gps.zoom) %}
    {% assign gps_zoom = page.gps.zoom %}
  {% endif %}
  <div id="mapa" style="height: 300px;"></div>
  <script type="text/javascript">
    var center = SMap.Coords.fromWGS84({{ page.gps.long }}, {{ page.gps.lat }});
    {% if page.mapycz_api == 'mini-api' %} // Mapy.cz Mini-API
      var mapa = new SMap(JAK.gel("mapa"), center, {{ gps_zoom }}, SMap.DEF_BASE);
      mapa.addMarker(center);
      {% else %} // default Mapy.cz API
      var mapa = new SMap(JAK.gel("mapa"), center, {{ gps_zoom }});
      mapa.addDefaultLayer(SMap.DEF_BASE).enable();
      var vrstva = new SMap.Layer.Marker();     /* Vrstva se značkami */
      var options = { }
      var znacka = new SMap.Marker(center, 'markerid', options);
      vrstva.addMarker(znacka);
      mapa.addLayer(vrstva);
      vrstva.enable();
    {% endif %}
  </script>

  {% capture href %}https://mapy.cz/zakladni?x={{page.gps.long}}&y={{page.gps.lat}}&z=16&source=coor&id={{page.gps.long}}%2C{{page.gps.lat}}{% endcapture %}
  {% include buttons/image.html href=href target="_blank" icon="ico--map" class="btn btn--black btn--fulwidth btn--hoveractive mt-4" cta="Zobrazit větší mapu" %}
{% endif %}

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
jekyll-theme-pirati-sk-1.0.0 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.7 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.6 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.5 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.4 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.3 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.1 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.4.0 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.3.0 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.2.2 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.2.1 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.2.0 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.1.0 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.0.0 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.0.0.pre.beta2 _includes/right-bar/bar_map.html
jekyll-theme-pirati-8.0.0.pre.beta1 _includes/right-bar/bar_map.html