Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

画面の横幅640px以下の端末で施設名表示縮尺調整 #42

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion js/ol_style.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var featureStyleList = {
};

var favoriteColor = '#FF0';
var phoneWidth = 640;

/**
* 保育施設共通のスタイル定義
Expand Down Expand Up @@ -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}),
Expand Down