mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-25 12:21:21 +01:00
Moved static map fallback to scripts.js
This commit is contained in:
parent
fbaeb935bb
commit
3a2946384c
5 changed files with 31 additions and 13 deletions
|
@ -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 %}
|
||||
</script>
|
||||
<script src="{{ "/js/scripts.js" | prepend: site.baseurl }}"></script>
|
||||
<script src="{{ "/js/scripts.min.js" | prepend: site.baseurl }}"></script>
|
||||
{% if page.permalink == '/schedule/' %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
|
BIN
img/other/map-marker.png
Normal file
BIN
img/other/map-marker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 172 KiB |
|
@ -293,6 +293,11 @@
|
|||
s.parentNode.insertBefore(po, s);
|
||||
}
|
||||
|
||||
// Google maps static
|
||||
if (typeof staticGoogleMaps !== 'undefined') {
|
||||
$('#canvas-map').addClass('image-section').css('background-image','url(http://maps.googleapis.com/maps/api/staticmap?zoom=17¢er=' + mobileCenterMapCoordinates +'&size=' + $(window).width() + 'x700&scale=2&language=en&markers=icon:' + icon +'|'+ eventPlaceCoordinates +'&maptype=roadmap&style=visibility:on|lightness:40|gamma:1.1|weight:0.9&style=element:labels|visibility:off&style=feature:water|hue:0x0066ff&style=feature:road|visibility:on&style=feature:road|element:labels|saturation:-30)');
|
||||
}
|
||||
|
||||
//Google maps
|
||||
if (typeof googleMaps !== 'undefined') {
|
||||
var map, autocomplete, directionsDisplay, geocoder, polyline, origin;
|
||||
|
|
2
js/scripts.min.js
vendored
2
js/scripts.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue