diff --git a/wlm-maps.js b/wlm-maps.js index a18b306..b4953ae 100644 --- a/wlm-maps.js +++ b/wlm-maps.js @@ -23,6 +23,7 @@ var layerWithPicMonuments; var withimageicon; var withoutimageicon; var browserlang; +var mobile; var withimage; var withoutimage; var encodedCSVUri; @@ -39,6 +40,11 @@ if (navigator.systemLanguage) { } browserlang = browserlang.split('-')[0]; +mobile = '0'; +if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || (window.innerWidth <= 800 && window.innerHeight <= 600) ) { + mobile = '1'; +} + $(document).ready(init); function geohack(latd,lond) { @@ -166,6 +172,12 @@ function getwebsite (country) { } function init() { + if (mobile == 1){ + $("#csv-button").hide(); + $("#gallery-div").hide(); + $("#share").hide(); + } + var osmUrl='//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmAttrib=translatemsg('osm-attrib'); @@ -276,12 +288,16 @@ function init() { //map.on('zoomend', whenMapMoves); //map.on('dragend', whenMapMoves); updateMonuments(); - askForRecentlyUploaded(); + if (mobile == 0){ + askForRecentlyUploaded(); + } } function whenMapMoves(e) { updateMonuments(); - askForRecentlyUploaded(); + if (mobile == 0){ + askForRecentlyUploaded(); + } } function setMarker(feature,latlng) { @@ -374,31 +390,32 @@ function updateMonuments() { } //csv - var csvContent = "data:text/csv;charset=utf-8,"; - for (var i=0;i