From 2bfdc3b5c2bf6f91b057bccaeba43d2c8b2b21ff Mon Sep 17 00:00:00 2001 From: Shigeki Nakamura Date: Thu, 24 Nov 2016 20:57:31 +0900 Subject: [PATCH] =?UTF-8?q?#37=20=E6=A8=AA=E5=B9=85640px=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E3=81=A7=E6=96=BD=E8=A8=AD=E5=90=8D=E8=A1=A8=E7=A4=BA=E7=B8=AE?= =?UTF-8?q?=E5=B0=BA=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/ol_style.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/ol_style.js b/js/ol_style.js index 8f7c4997..be6ef607 100644 --- a/js/ol_style.js +++ b/js/ol_style.js @@ -10,6 +10,7 @@ var featureStyleList = { }; var favoriteColor = '#FF0'; +var phoneWidth = 640; /** * 保育施設共通のスタイル定義 @@ -41,8 +42,15 @@ var nurseryStyleFunction = function(feature, resolution) { resolution = Math.floor(resolution * 1000); var _type = ""; + var text = ""; var label = feature.get('ラベル') ? feature.get('ラベル') : feature.get('Label') - var text = resolution < 10000 ? label : ''; + // スマホの場合、マップ上で施設名が表示される縮尺を調整 + var width = $(window).width(); + if ( width <= phoneWidth ) { + text = resolution < 9000 ? label : ''; + } else { + text = resolution < 10000 ? label : ''; + } var style = []; style = [ new ol.style.Style({image: background}),