From 3a2946384c0cc51f35557226e87480ab3b4c38ac Mon Sep 17 00:00:00 2001 From: Oleh Zasadnyy Date: Mon, 1 Sep 2014 13:49:06 +0300 Subject: [PATCH] Moved static map fallback to scripts.js --- _layouts/default.html | 37 ++++++++++++++++++--------- img/other/map-marker.png | Bin 0 -> 2534 bytes img/sections-background/schedule.jpg | Bin 261087 -> 176601 bytes js/scripts.js | 5 ++++ js/scripts.min.js | 2 +- 5 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 img/other/map-marker.png diff --git a/_layouts/default.html b/_layouts/default.html index 5a78171..e6dce14 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -54,13 +54,17 @@ Waves.displayEffect(); {% if page.permalink == '/' %} if ($(window).width() > 767) { - var googleMaps = 'index', - eventPlace = new google.maps.LatLng({{ site.eventPlaceCoordinates }}), - centerMap = new google.maps.LatLng({{ site.mapCenterCoordinates }}), - mobileCenterMap = new google.maps.LatLng({{ site.mapMobileCenterCoordinates }}), - icon = '{{ site.baseurl }}/img/other/map-marker.svg'; + var googleMaps = 'index', + eventPlace = new google.maps.LatLng({{ site.eventPlaceCoordinates | replace:' ','' }}), + centerMap = new google.maps.LatLng({{ site.mapCenterCoordinates | replace:' ','' }}), + mobileCenterMap = new google.maps.LatLng({{ site.mapMobileCenterCoordinates | replace:' ','' }}), + icon = '{{ site.baseurl }}/img/other/map-marker.svg'; } else { - $('#canvas-map').addClass('image-section').css('background-image','url(http://maps.googleapis.com/maps/api/staticmap?zoom=17¢er={{ site.mapMobileCenterCoordinates | replace:' ','' }}&size=' + $(window).width() + 'x700&scale=2&language=en&markers={{ site.eventPlaceCoordinates | replace:' ','' }})'); + var staticGoogleMaps = true, + eventPlaceCoordinates = '{{ site.eventPlaceCoordinates | replace:' ','' }}', + centerMapCoordinates = '{{ site.mapCenterCoordinates | replace:' ','' }}', + mobileCenterMapCoordinates = '{{ site.mapMobileCenterCoordinates | replace:' ','' }}', + icon = '{{ site.baseurl | prepend: site.url }}/img/other/map-marker.png'; } var twitterFeedUrl = '{{ site.twitterFeed }}'; $(document).ready(function () { @@ -103,14 +107,23 @@ mobileCenterMap = new google.maps.LatLng({{ site.logisticsMapMobileCenterCoordinates }}), icon = '{{ site.baseurl }}/img/other/map-marker.svg'; {% elsif page.permalink == '/hackathon/' %} - var googleMaps = 'hackathon', - eventPlace = new google.maps.LatLng({{ site.hackathonPlaceCoordinates }}), - centerMap = new google.maps.LatLng({{ site.hackathonMapCenterCoordinates }}), - mobileCenterMap = new google.maps.LatLng({{ site.hackathonMapMobileCenterCoordinates }}), - icon = '{{ site.baseurl }}/img/other/map-marker.svg'; + if ($(window).width() > 767) { + var googleMaps = 'hackathon', + eventPlace = new google.maps.LatLng({{ site.hackathonPlaceCoordinates }}), + centerMap = new google.maps.LatLng({{ site.hackathonMapCenterCoordinates }}), + mobileCenterMap = new google.maps.LatLng({{ site.hackathonMapMobileCenterCoordinates }}), + icon = '{{ site.baseurl }}/img/other/map-marker.svg'; + } else { + var staticGoogleMaps = true, + eventPlaceCoordinates = '{{ site.hackathonPlaceCoordinates | replace:' ','' }}', + centerMapCoordinates = '{{ site.hackathonMapCenterCoordinates | replace:' ','' }}', + mobileCenterMapCoordinates = '{{ site.hackathonMapMobileCenterCoordinates | replace:' ','' }}', + icon = '{{ site.baseurl | prepend: site.url }}/img/other/map-marker.png'; + } + {% endif %} - + {% if page.permalink == '/schedule/' %}