mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-26 12:41:23 +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();
|
Waves.displayEffect();
|
||||||
{% if page.permalink == '/' %}
|
{% if page.permalink == '/' %}
|
||||||
if ($(window).width() > 767) {
|
if ($(window).width() > 767) {
|
||||||
var googleMaps = 'index',
|
var googleMaps = 'index',
|
||||||
eventPlace = new google.maps.LatLng({{ site.eventPlaceCoordinates }}),
|
eventPlace = new google.maps.LatLng({{ site.eventPlaceCoordinates | replace:' ','' }}),
|
||||||
centerMap = new google.maps.LatLng({{ site.mapCenterCoordinates }}),
|
centerMap = new google.maps.LatLng({{ site.mapCenterCoordinates | replace:' ','' }}),
|
||||||
mobileCenterMap = new google.maps.LatLng({{ site.mapMobileCenterCoordinates }}),
|
mobileCenterMap = new google.maps.LatLng({{ site.mapMobileCenterCoordinates | replace:' ','' }}),
|
||||||
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
|
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
|
||||||
} else {
|
} 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 }}';
|
var twitterFeedUrl = '{{ site.twitterFeed }}';
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
@ -103,14 +107,23 @@
|
||||||
mobileCenterMap = new google.maps.LatLng({{ site.logisticsMapMobileCenterCoordinates }}),
|
mobileCenterMap = new google.maps.LatLng({{ site.logisticsMapMobileCenterCoordinates }}),
|
||||||
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
|
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
|
||||||
{% elsif page.permalink == '/hackathon/' %}
|
{% elsif page.permalink == '/hackathon/' %}
|
||||||
var googleMaps = 'hackathon',
|
if ($(window).width() > 767) {
|
||||||
eventPlace = new google.maps.LatLng({{ site.hackathonPlaceCoordinates }}),
|
var googleMaps = 'hackathon',
|
||||||
centerMap = new google.maps.LatLng({{ site.hackathonMapCenterCoordinates }}),
|
eventPlace = new google.maps.LatLng({{ site.hackathonPlaceCoordinates }}),
|
||||||
mobileCenterMap = new google.maps.LatLng({{ site.hackathonMapMobileCenterCoordinates }}),
|
centerMap = new google.maps.LatLng({{ site.hackathonMapCenterCoordinates }}),
|
||||||
icon = '{{ site.baseurl }}/img/other/map-marker.svg';
|
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 %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
<script src="{{ "/js/scripts.js" | prepend: site.baseurl }}"></script>
|
<script src="{{ "/js/scripts.min.js" | prepend: site.baseurl }}"></script>
|
||||||
{% if page.permalink == '/schedule/' %}
|
{% if page.permalink == '/schedule/' %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(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);
|
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
|
//Google maps
|
||||||
if (typeof googleMaps !== 'undefined') {
|
if (typeof googleMaps !== 'undefined') {
|
||||||
var map, autocomplete, directionsDisplay, geocoder, polyline, origin;
|
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