if (typeof H_MVT === 'undefined') {
var H_MVT = {};
}
(function () {
//全国河川中心線------------------------------------------------------------------------------------------------------
function suiroStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var rivCtg = prop["rivCtg"];
var type = prop["type"];
var strokeColor = "dodgerblue";
var strokeWidth = 1;
var lineDash = [];
switch (rivCtg) {
case "一級河川":
strokeColor = "mediumblue";
strokeWidth = 2;
lineDash = [1];
break;
case "二級河川":
strokeColor = "blue";
strokeWidth = 2;
lineDash = [1];
break;
default:
}
switch (type) {
case "人工水路(地下)":
strokeColor = "red";
strokeWidth = 2;
lineDash = [2, 4];
break;
case "人工水路(空間)":
strokeColor = "red";
strokeWidth = 2;
lineDash = [1];
break;
default:
}
if (resolution > 611.50) strokeWidth = 1;
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: strokeColor,
width: strokeWidth,
lineDash: lineDash
})
});
return style;
}
function suiro() {
this.folder = "child";
this.category = "ToshiDouroKasen";
this.icon = "";
this.title = "全国河川中心線(MVT)";
this.name = "suiro";
this.origin = "rvrcl-vt";
this.detail = "";
this.style = suiroStyleFunction;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom: 14,
url: H_CONFIG.pFunc("https://hfu.github.io/rvrcl-vt/{z}/{x}/{y}.mvt")
});
}
H_MVT.suiro1 = new ol.layer.VectorTile(new suiro());
H_MVT.suiro2 = new ol.layer.VectorTile(new suiro());
//全国河川中心線ここまで-----------------------------------------------------------------------------------------------
//全国道路中心線------------------------------------------------------------------------------------------------------
function douroStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var syurui = prop["rdCtg"];
var haba = prop["rnkWidth"];
var strokeColor = null;
var strokeWidth = null;
var lineDash = [];
switch (syurui) {
case "高速自動車国道等":
strokeColor = "red";
strokeWidth = 4;
strokeColor = "red";
lineDash = [1];
break;
case "国道":
strokeColor = "green";
strokeWidth = 4;
lineDash = [1];
break;
case "都道府県道":
strokeColor = "black";
strokeWidth = 2;
break;
default:
if(haba!="3m未満") {
strokeColor = "blue";
strokeWidth = 1;
lineDash = [1];
}else{
strokeColor = "red";
strokeWidth = 1;
lineDash = [1,2];
}
}
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
color:strokeColor,
width: strokeWidth,
lineDash:lineDash
})
});
return style;
}
function douro(){
this.folder = "child";
this.category = "ToshiDouroKasen";
this.icon = "";
this.title = "全国道路中心線(MVT)";
this.name = "douro";
this.origin = "chome-vt";
this.detail = "ズーム率14以上で全て描画します。
高速道路=赤、国道=緑、都道府県道=黒、幅3m未満=赤破線";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:14,
url: H_CONFIG.pFunc("https://hfu.github.io/rdcl-vt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 1222.99;
this.style = douroStyleFunction;
}
H_MVT.douro1 = new ol.layer.VectorTile(new douro());
H_MVT.douro2 = new ol.layer.VectorTile(new douro());
//全国道路中心線ここまで-----------------------------------------------------------------------------------------------
//全国用途地域--------------------------------------------------------------------------------------------------------
H_MVT.youtotiikiStyleFunction = function (target) {
return function (feature, resolution) {
var prop = feature.getProperties();
var cate = prop["A29_004"];
var rgba = "rgba(0,0,0,0)";
if(target !== 0) {
if(cate !== target) cate = 99;
}
switch (cate) {
case 1://第一種低層住居専用地域
rgba = "rgba(51,204,153,0.8)";
break;
case 2://第二種低層住居専用地域
rgba = "rgba(0,153,102,0.8)";
break;
case 3://第一種中高層住居専用地域
rgba = "rgba(102,204,102,0.8)";
break;
case 4://第二種中高層住居専用地域
rgba = "rgba(204,255,153,0.8)";
break;
case 5://第一種住居地域
rgba = "rgba(255,255,153,0.8)";
break;
case 6://第二種住居地域
rgba = "rgba(255,204,153,0.8)";
break;
case 7://準住居地域
rgba = "rgba(255,204,102,0.8)";
break;
case 8://近隣商業地域
rgba = "rgba(255,153,204,0.8)";
break;
case 9://商業地域
rgba = "rgba(255,102,153,0.8)";
break;
case 10://準工業地域
rgba = "rgba(204,153,255,0.8)";
break;
case 11://工業地域
rgba = "rgba(204,255,255,0.8)";
break;
case 12://工業専用地域
rgba = "rgba(102,204,255,0.8)";
break;
case 99://
rgba = "rgba(0,0,0,0.1)";
break;
}
var style;
if (resolution < 125.87) {
style = new ol.style.Style({
fill: new ol.style.Fill({color: rgba}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
style = new ol.style.Style({
fill: new ol.style.Fill({color: rgba})
});
}
return style;
}
};
function youtotiiki(){
this.folder = "child";
this.category = "ToshiDouroKasen";
this.icon = "";
this.title = "全国用途地域(MVT)";
this.name = "youtotiiki";
this.origin = "国土数値情報 用途地域データ";
this.detail = "A29-11_01_GML~A29-11_47_GML 23年度";
this.detail2 = "
" +
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/youtotiiki/{z}/{x}/{y}.mvt"
});
this.style = H_MVT.youtotiikiStyleFunction(0);
}
H_MVT.youtotiiki1 = new ol.layer.VectorTile(new youtotiiki());
H_MVT.youtotiiki2 = new ol.layer.VectorTile(new youtotiiki());
//全国用途地域ここまで-------------------------------------------------------------------------------------------------
//全国都市地域-------------------------------------------------------------------------------------------------------
function tositiiki(){
this.folder = "child";
this.category = "ToshiDouroKasen";
this.icon = "";
this.title = "全国都市地域(MVT)";
this.name = "tositiiki";
this.origin = "";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url:H_CONFIG.pFunc('https://kenzkenz2.xsrv.jp/to/{z}/{x}/{y}.mvt')
});
this.style = tositiikiStyleFunction;
}
function tositiikiStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var layerNo = prop["layer_no"];
var rgba = "black";
var zindex = 0;
switch (layerNo) {
case 1://都市地域
rgba = "rgba(40,152,53,0.7)";
break;
case 2://市街化区域
rgba = "rgba(239,255,3,0.7)";
zindex = 1;
break;
case 3://市街化調整区域
rgba = "rgba(126,219,109,0.7)";
break;
case 4://その他用途地域
rgba = "rgba(253,191,111,0.7)";
break;
}
var style;
if(resolution<125.87) {
style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
}),
zIndex:zindex
});
}else{
style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
zIndex:zindex
});
}
return style;
}
H_MVT.tositiiki1 = new ol.layer.VectorTile(new tositiiki());
H_MVT.tositiiki2 = new ol.layer.VectorTile(new tositiiki());
//全国都市地域ここまで------------------------------------------------------------------------------------------------
//全国海岸線----------------------------------------------------------------------------------------------------------
H_MVT.kaigansebStyleFunction = function (color,width) {
return function (feature, resolution) {
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: color,
width: width
})
});
return style;
}
};
function kaigansen_() {
this.folder = "child";
this.category = "ToshiDouroKasen";
this.icon = "";
this.title = "全国海岸線(MVT)";
this.name = "kaigansen";
this.origin = "国土数値情報 海岸線データ(H18年度)";
this.detail = "";
this.detail2 =
"" +
" 色選択:"+
"" +
" 線幅選択:"+
"" +
"
";
this.style = H_MVT.kaigansebStyleFunction("black",1);
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:14,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/kaigansen_mvt/{z}/{x}/{y}.mvt")
});
}
H_MVT.kaigansen_1 = new ol.layer.VectorTile(new kaigansen_());
H_MVT.kaigansen_2 = new ol.layer.VectorTile(new kaigansen_());
//全国海岸線ここまで--------------------------------------------------------------------------------------------------
//全国鉄道-----------------------------------------------------------------------------------------------------------
H_MVT.railroadStyleFunction = function() {
return function(feature, resolution) {
var zoom = H_COMMON.zoomForResolution(resolution);
var prop = feature.getProperties();
var color = "navy";
var width = 3;
var zindex = 0;
var syubetu = prop["N02_002"];
var stationName = prop["N02_005"];//駅
if(stationName) {
if(zoom<11) {
width = 4;
}else{
width = 10;
}
color = "red";
zindex = 1;
}else{
if(syubetu==="1") {
color = "limegreen";
if(zoom<8) {
width = 3;
}else{
width = 6;
}
}else{
if(zoom<8){
width = 1;
}
}
}
var text = "";
var styles = [];
var fillStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: color
})
});
var strokeStyle = new ol.style.Style({
stroke: new ol.style.Stroke({
color:color,
width: width
}),
zIndex:zindex
});
var textStyle = new ol.style.Style({
text: new ol.style.Text({
font: "14px sans-serif",
text: text,
//offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
overflow:true,
exceedLength:true,
placement:"point"
})
});
if(zoom<10) {
if (!stationName) {
styles.push(strokeStyle);
}else{
return;
}
}else{
styles.push(strokeStyle);
}
//styles.push(strokeStyle);
return styles;
};
};
function Railroad(){
this.folder = "child";
this.category = "ToshiDouroKasen";
this.icon = "";
this.title = "全国鉄道(MVT)";
this.name = "railroad";
this.origin = "国土数値情報 鉄道データ";
this.detail = "";
this.detail2 = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/railroad/{z}/{x}/{y}.mvt")
});
this.style = H_MVT.railroadStyleFunction()
}
H_MVT.railroad1 = new ol.layer.VectorTile(new Railroad());
H_MVT.railroad2 = new ol.layer.VectorTile(new Railroad());
//全国鉄道ここまで----------------------------------------------------------------------------------------------------
//全国土壌図---------------------------------------------------------------------------------------------------------
H_MVT.dozyouzu1 = new ol.layer.VectorTile(new dozyouzu());
H_MVT.dozyouzu2 = new ol.layer.VectorTile(new dozyouzu());
function dozyouzu(){
this.folder = "child";
this.category = "tisitutikei";
this.icon = "";
this.title = "全国土壌図(MVT)";
this.name = "dozyouzu";
this.origin = "農研機構";
this.detail = "";
this.detail2 = "" +
"土壌分類選択:" +
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/dozyouzu/{z}/{x}/{y}.mvt"
});
this.style = dozyouzuStyleFunction;
}
var dozyouzuTarget = "0";
function dozyouzuStyleFunction(feature, resolution) {
var prop = feature.getProperties();
//var cate = prop["SSerGrCD"];
if(prop["SG_CD"]) {
var cate = prop["SG_CD"].substr(0, 1);
var cate2 = prop["SG_CD"].substr(1, 1);
}else{
return;
}
var rgba = "rgba(0,0,0,0.5)";
if(dozyouzuTarget==cate || dozyouzuTarget==0) {
switch (cate) {
case "A"://造成土
var r = 255 - Number(cate2) * 10;
rgba = "rgba(" + r + ",255,255,0.8)";
break;
case "B"://有機質土
rgba = "rgba(0,0,0,0.8)";
break;
case "C"://ポドゾル
rgba = "rgba(76,0,115,0.8)";
break;
case "D"://黒ボク土
//console.log(cate2)
switch (cate2){
case "1"://未熟黒ボク土
rgba = "rgba(245,150,79,0.8)";
break;
case "2"://グライ黒ボク土
rgba = "rgba(244,146,117,0.8)";
break;
case "3"://多湿黒ボク土
rgba = "rgba(232,71,57,0.8)";
break;
case "4"://褐色黒ボク土
rgba = "rgba(226,125,70,0.8)";
break;
case "5"://非アロフェン質黒ボク土
rgba = "rgba(137,101,97,0.8)";
break;
case "6"://アロフェン質黒ボク土
rgba = "rgba(156,67,54,0.8)";
//console.log(rgba);
break;
}
break;
case "E"://暗赤色土
switch (cate2){
case "1"://石灰性暗赤色土
rgba = "rgba(128,41,86,0.8)";
break;
case "2"://酸性暗赤色土
rgba = "rgba(194,30,139,0.8)";
break;
case "3"://塩基性暗赤色土
rgba = "rgba(235,52,149,0.8)";
break;
}
break;
case "F"://低地土
switch (cate2){
case "1"://低地水田土
rgba = "rgba(26,115,186,0.8)";
break;
case "2"://グライ低地土
rgba = "rgba(82,62,153,0.8)";
break;
case "3"://灰色低地土
rgba = "rgba(48,41,104,0.8)";
break;
case "4"://褐色低地土
rgba = "rgba(0,138,172,0.8)";
break;
case "5"://未熟低地土
rgba = "rgba(0,172,228,0.8)";
break;
}
break;
case "G"://赤黄色土
switch (cate2){
case "1"://粘土集積赤黄色土
rgba = "rgba(237,72,56,0.8)";
break;
case "2"://風化変質赤黄色土
rgba = "rgba(239,119,174,0.8)";
break;
}
break;
case "H"://停滞水成土
switch (cate2){
case "1"://停滞水グライ土
rgba = "rgba(122,203,198,0.8)";
break;
case "2"://疑似グライ土
rgba = "rgba(164,209,134,0.8)";
break;
}
break;
case "I"://褐色森林土
rgba = "rgba(0,149,83,0.8)";
break;
case "J"://未熟土
switch (cate2){
case "1"://火山放出物未熟土
rgba = "rgba(217,172,139,0.8)";
break;
case "2"://砂質未熟土
rgba = "rgba(239,208,172,0.8)";
break;
case "3"://固結岩屑土
rgba = "rgba(204,202,63,0.8)";
break;
case "4"://陸成未熟土
rgba = "rgba(251,242,109,0.8)";
break;
}
break;
case "Z"://市街地/水域など
switch (cate2){
case "1"://岩石地
rgba = "rgba(116,121,132,0.8)";
break;
case "2"://???
rgba = "red";
break;
case "3"://市街地/水域など
rgba = "rgba(255,255,255,0.8)";
break;
}
break;
}
}else{
return;
}
if(resolution<125.87) {
//console.log(rgba)
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
}else{
//if(val<0.2) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
//全国土壌図ここまで--------------------------------------------------------------------------------------------------
//エコリス植生図-----------------------------------------------------------------------------------------------------
H_MVT.syokusei1 = new ol.layer.VectorTile(new syokusei());
H_MVT.syokusei2 = new ol.layer.VectorTile(new syokusei());
function syokusei(){
this.folder = "child";
this.category = "tisitutikei";
this.icon = "";
this.title = "エコリス植生図(MVT)";
this.name = "syokusei";
this.origin = "エコリス地図タイル";
this.detail = "第5回 自然環境保全基礎調査 植生調査結果を着色したものです。バイナリベクトルタイルの実験です。エコリス植生図(ラスタ)も参照してください。";
this.detail2 = "" +
"植生で選択 " +
"" +
"
植林で選択 " +
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/ecoris/{z}/{x}/{y}.mvt"
});
this.style = syokuseizuStyleFunction
}
var syokuseiTarget = "0";
function syokuseizuStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var SYOKU = prop["SYOKU_C"];
//console.log(cate);
var rgba = "rgba(0,0,0,0.5)";
if(syokuseiTarget.substr(0,1)!=="b") {
if (syokuseiTarget == SYOKU || syokuseiTarget == 0) {
switch (SYOKU) {
case 1://
rgba = "#fdf1ce";
break;
case 2://
rgba = "#997f60";
break;
case 3://
rgba = "#a58f74";
break;
case 4://
rgba = "#178017";
break;
case 5://
rgba = "#5b9700";
break;
case 6://
rgba = "#003300";
break;
case 7://
rgba = "#004a00";
break;
case 8://
rgba = "#ffff00";
break;
case 9://
rgba = "#8cd27d";
break;
case 10://
//return;
rgba = "#868585";
break;
}
var DAI = prop["DAI_N"];
switch (DAI) {
case "植林地":
rgba = "#697720";
break;
case "竹林":
rgba = "#cccc20";
break;
case "牧草地・ゴルフ場・芝地":
rgba = "#69ff00";
break;
case "耕作地":
rgba = "#999662";
break;
}
var HANREI = prop["HANREI_N"];
switch (HANREI) {
case "水田雑草群落":
rgba = "#8cd27d";
break;
case "開放水域":
rgba = "#99ffff";
break;
//-----------------------
/*
case "常緑針葉樹植林":
rgba = "#fd4202";
break;
case "スギ・ヒノキ・サワラ植林":
rgba = "#fd4202";
break;
case "スギ植林":
rgba = "#fd4202";
break;
case "スギ・ヒノキ植林":
rgba = "#fd4202";
break;
*/
}
} else {
return;
}
}else{
var HANREI = prop["HANREI_N"];
if (syokuseiTarget.split("-")[1] == HANREI || syokuseiTarget == 0) {
switch (HANREI) {
case "常緑針葉樹植林":
rgba = "#fd4202";
break;
case "スギ・ヒノキ・サワラ植林":
rgba = "#fd4202";
break;
case "スギ植林":
rgba = "#fd4202";
break;
case "スギ・ヒノキ植林":
rgba = "#fd4202";
break;
case "開放水域":
rgba = "#99ffff";
break;
//-----------------------
/*
case "常緑針葉樹植林":
rgba = "#fd4202";
break;
case "スギ・ヒノキ・サワラ植林":
rgba = "#fd4202";
break;
case "スギ植林":
rgba = "#fd4202";
break;
case "スギ・ヒノキ植林":
rgba = "#fd4202";
break;
*/
}
}else{
return;
}
/*
"" +
"" +
"" +
"" +
"" +
*/
}
if(resolution<4.78) {//14は9.55
//if(resolution<19.11) {//13
//console.log(rgba)
var text = prop["HANREI_N"];
var textColor = "white";
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
//rotation: prop["arrngAgl"],
fill: new ol.style.Fill({
color:textColor
}),
exceedLength:true
/*
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
*/
})
});
}else{
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
//エコリス植生図ここまで-----------------------------------------------------------------------------------------------
//全国小地域人口等----------------------------------------------------------------------------------------------------
//スタイルファンクション
H_MVT.syoutiikiCommonStyleFunction = function (arguments) {
var maxColor,limit,moji;
if(arguments["moji"]) {
maxColor = null;
limit = null;
moji = arguments["moji"]["val"];
}else{
maxColor = arguments["maxColor"]["val"];
limit = arguments["limit"]["val"];
moji = null;
}
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var prop = feature.getProperties();
var areaHa = prop["AREA"] / 10000;//ヘクタール
var val = Math.floor(prop["JINKO"] / areaHa);
val = val / limit;
if (val > 1) val = 1;
var rgb = d3.rgb(d3Color(val));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
var style;
if(moji) {
if(prop["MOJI"]) {
var str = moji.replace(/^\s+|\s+$/g,'');
str = str.replace(/ /g,"|").replace(/ /g,"|");
var regexp = new RegExp(str, 'g');
var match = prop["MOJI"].match(regexp);
if(match) {
style = new ol.style.Style({
fill: new ol.style.Fill({
color: "rgba(255,0,0,0.6)"
}),
stroke: new ol.style.Stroke({
color: "black",
width: 1
})
});
}else{
return;
}
}else{
return;
}
}else{
if (resolution < 125.87) {
style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
if (val < 0.2) return;
style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
}
return style;
}
};
var syoutiikiDetail = "1haあたりの人口が上限値を越えると色が最大に濃くなる。それ以上は同じ。" +
"
小地域名で検索するときは全て赤色"
var syoutiikiDetail2 = "" +
"人口/1haの上限:人" +
" 色:"+
"" +
"
" +
"小地域名:" +
"" +
" " +
"";
//-------------------
//H17
H_MVT.syoutiikiH17_1 = new ol.layer.VectorTile(new syoutiikiH17());
H_MVT.syoutiikiH17_2 = new ol.layer.VectorTile(new syoutiikiH17());
function syoutiikiH17(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H17全国小地域人口等(MVT)";
this.name = "chomeH17";
this.origin = "e-stat";
this.detail = syoutiikiDetail;
this.detail2 = syoutiikiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/kokucyou/h17/{z}/{x}/{y}.mvt"
});
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":100},
//"moji":{"val":"島"}
};
this.style = H_MVT.syoutiikiCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syoutiikiCommonStyleFunction;
}
//-------------------
//H22
H_MVT.syoutiikiH22_1 = new ol.layer.VectorTile(new syoutiikiH22());
H_MVT.syoutiikiH22_2 = new ol.layer.VectorTile(new syoutiikiH22());
function syoutiikiH22(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H22全国小地域人口等(MVT)";
this.name = "chomeH22";
this.origin = "e-stat";
this.detail = syoutiikiDetail;
this.detail2 = syoutiikiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/kokucyou/h22/{z}/{x}/{y}.mvt"
});
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":100},
//"moji":{"val":null}
};
this.style = H_MVT.syoutiikiCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syoutiikiCommonStyleFunction;
this.declutter = true;
this.preload = 3;
}
//-------------------
//H27
H_MVT.syoutiiki1 = new ol.layer.VectorTile(new SyoutiikiH27());
H_MVT.syoutiiki2 = new ol.layer.VectorTile(new SyoutiikiH27());
function SyoutiikiH27(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H27全国小地域人口等(MVT)";
this.name = "chomeH27";
this.origin = "e-stat";
this.detail = syoutiikiDetail;
this.detail2 = syoutiikiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/h27syouchiiki_mvt/{z}/{x}/{y}.mvt")
});
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":100},
//"moji":{"val":null}
};
this.style = H_MVT.syoutiikiCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syoutiikiCommonStyleFunction;
this.declutter = true;
this.preload = 3;
}
//-------------------
//S05
H_MVT.s05KokuchoCommonStyleFunction = function (arguments) {
var maxColor,limit,moji;
if(arguments["moji"]) {
maxColor = null;
limit = null;
moji = arguments["moji"]["val"];
}else{
maxColor = arguments["maxColor"]["val"];
limit = arguments["limit"]["val"];
moji = null;
}
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var zoom = H_COMMON.zoomForResolution(resolution);
var geoType = feature.getGeometry().getType();
var prop = feature.getProperties();
var rgb,rgba;
//rgb = d3.rgb(d3syougakkoukuColor(Number(prop["polygonID"])));
//rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.7)";
var styles = [];
var fillStyle;
switch (geoType){
case "MultiPoint":
case "Point":
var textStyle = new ol.style.Style({
text: new ol.style.Text({
font: "8px sans-serif",
text: prop["昭和5年市町村"],
//offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
if(zoom>9) {
styles.push(textStyle);
}
break;
case "Polygon":
case "MultiPolygon":
if(moji) {
if(prop["昭和5年市町村"]) {
var str = moji.replace(/^\s+|\s+$/g,'');
str = str.replace(/ /g,"|").replace(/ /g,"|");
var regexp = new RegExp(str, 'g');
var match = prop["昭和5年市町村"].match(regexp);
if(match) {
fillStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: "rgba(255,0,0,0.6)"
}),
stroke: new ol.style.Stroke({
color: "black",
width: 1
})
});
styles.push(fillStyle);
}else{
return;
}
}else{
return;
}
}else{
var areaHa = prop["area"] / 10000 /1.245526;//ヘクタール
var val = Math.floor(prop["昭和五年人口(総数)"] / areaHa);
val = val / limit;
//console.log(val);
if (val > 1) val = 1;
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
fillStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
var strokeStyle = new ol.style.Style({
stroke: new ol.style.Stroke({
color: "gray",
width: 1
})
});
if (zoom > 9) {
styles.push(fillStyle);
styles.push(strokeStyle);
} else {
styles.push(fillStyle);
}
}
break;
}
return styles;
}
};
H_MVT.syoutiikiS05_1 = new ol.layer.VectorTile(new SyoutiikiS05());
H_MVT.syoutiikiS05_2 = new ol.layer.VectorTile(new SyoutiikiS05());
function SyoutiikiS05(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "S05全国市町村人口等(MVT)";
this.name = "s05kokucho";
this.origin = "昭和5年の国勢調査データです。歴史地域統計データ(筑波大学)";
this.detail = "1haあたりの人口が上限値を越えると色が最大に濃くなる。それ以上は同じ。" +
"
小地域名で検索するときは全て赤色";
this.detail2 = "人口/1haの上限:人" +
" 色:"+
"" +
"
" +
"町村名:" +
"" +
" " +
"";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/s05kokuchomix/{z}/{x}/{y}.mvt")
});
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":10}
//"moji":{"val":null}
};
this.style = H_MVT.s05KokuchoCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.s05KokuchoCommonStyleFunction;
this.declutter = true;
this.preload = 3;
}
//-------------------
//H27-2
H_MVT.syoutiikiCommonStyleFunction2 = function (arguments) {
var target = arguments["target"]["val"];
var maxColor = arguments["maxColor"]["val"];
var limit = arguments["limit"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var prop = feature.getProperties();
var val,rate;
var sousuu = Number(prop["sousuu"]);
if(target==="genekihutan") {
var geneki = Number(prop["sou15_64"]) - Number(prop["sou15_19"]);
var rounen = Number(prop["sou65_"]);
rate = rounen / (geneki * limit);
val = rate;
}else{
if(prop[target]!=="-" && prop[target]!=="X") {
rate = Number(prop[target]) / (sousuu * limit);
val = rate;
}else{
val = 0;
}
}
var rgb = d3.rgb(d3Color(val));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
if (resolution < 125.87) {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
if (val < 0.2) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
H_MVT.syoutiikiH27_21 = new ol.layer.VectorTile(new SyoutiikiH27_2());
H_MVT.syoutiikiH27_22 = new ol.layer.VectorTile(new SyoutiikiH27_2());
function SyoutiikiH27_2(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H27全国小地域人口(年齢5歳階級)(MVT)";
this.name = "chomeH27_2";
this.origin = "e-stat";
// this.detail = "1haあたりの人口が上限値を越えると色が最大に濃くなる。それ以上は同じ。";
this.detail2 = "" +
"年齢"+
"" +
" 色"+
"" +
" 上限"+
"" +
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/h27syouchiiki_mvt2/{z}/{x}/{y}.mvt")
});
var arguments = {
"target":{"val":"sou65_"},
"maxColor":{"val":"red"},
"limit":{"val":0.8}
};
this.style = H_MVT.syoutiikiCommonStyleFunction2(arguments);
this.myStyleFunction = H_MVT.syoutiikiCommonStyleFunction2;
this.declutter = true;
this.preload = 3;
}
//全国小地域人口等ここまで---------------------------------------------------------------------------------------------
//500Mメッシュ-------------------------------------------------------------------------------------------------------
H_MVT.mesh500CommonStyleFunction = function(arguments) {
var maxColor = arguments["maxColor"]["val"];
var limit = arguments["limit"]["val"];
var year = arguments["year"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var prop = feature.getProperties();
if(year==="h99") {//比較
var h07 = prop["h07"];
if (!h07) h07 = 0;
var h27 = prop["h27"];
if (!h27) h27 = 0;
var val = h27 / h07;
if (isNaN(val)) return;//0割る0のとき
if (!isFinite(val)) val = 999;
val = val - 1;
if (val <= 0) {
if (h27 === 0) {
d3Color = d3.interpolateLab("white", "black");
} else {
d3Color = d3.interpolateLab("white", "red");
val = val * 2;
}
val = Math.abs(val);
} else {
d3Color = d3.interpolateLab("white", "blue");
}
var rgb = d3.rgb(d3Color(val));
if(val>1) val = 1;
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.6 + ")";
}else if(year==="nensyou"){
if(prop["HTKSYORI"]) return;
var souzinkou = Number(prop["h27"]);
var nensyou = Number(prop["T000847006"]);
var ritu = nensyou / souzinkou;
if(isNaN(ritu)) return;
ritu = ritu * 4;
if(ritu>2) ritu = 2;
d3Color = d3.interpolateLab("white","green");
var rgb = d3.rgb(d3Color(ritu));
if(ritu>0.8) ritu = 0.8;
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + ritu + ")";
}else if(year==="seisan"){
if(prop["HTKSYORI"]) return;
var souzinkou = Number(prop["h27"]);
var seisan = Number(prop["T000847012"]);
var ritu = seisan / souzinkou;
if(isNaN(ritu)) return;
ritu = (ritu-0.1) * 1.5;
d3Color = d3.interpolateLab("white","blue");
var rgb = d3.rgb(d3Color(ritu));
if(ritu>0.8) ritu = 0.8;
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + ritu + ")";
}else if(year==="rounen"){
if(prop["HTKSYORI"]) return;
var souzinkou = Number(prop["h27"]);
var rounen = Number(prop["T000847018"]);
var ritu = rounen / souzinkou;
if(isNaN(ritu)) return;
ritu = (ritu-0.15) * 4;
d3Color = d3.interpolateLab("white","red");
var rgb = d3.rgb(d3Color(ritu));
if(ritu>0.8) ritu = 0.8;
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + ritu + ")";
}else if(year==="hutanritu"){
if(prop["HTKSYORI"]) return;
var geneki = Number(prop["T000847015"]) - Number(prop["T000847009"]) + Number(prop["T000847012"]);
var rounen = Number(prop["T000847018"]);
var ritu = rounen / geneki;
if(isNaN(ritu)) return;
if(ritu>=1.0) {
var rgba = "rgba(139,0,0,0.8)"
}else if(ritu>=0.8) {
var rgba = "rgba(255,0,0,0.8)"
}else if(ritu>=0.6) {
var rgba = "rgba(255,165,0,0.8)"
}else if(ritu>=0.4) {
var rgba = "rgba(255,255,0,0.8)"
}else if(ritu>=0.3) {
var rgba = "rgba(0,128,0,0.8)"
}else{
var rgba = "rgba(0,0,250,0.8)"
}
}else{//通常
var val = prop[year];
if(!val) return;
val = val / limit;
//if(val<0.05) return;
if (val > 1) val = 1;
var rgb = d3.rgb(d3Color(val));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
}
//var text = prop[year];
if (resolution < 19.11) {
//if (!val) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
//if (!val) return;
if(val<0.05) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
H_MVT.mesh500Detail0 = "現役世代負担率=
20〜64歳に対する65歳以上人口の割合
" +
"・赤=1.0以上 高負担
" +
"・赤=0.8以上
" +
"・橙=0.6以上
" +
"・黄=0.4以上
" +
"・緑=0.3以上
" +
"・青=0.3未満 低負担
";
H_MVT.mesh500Detail1 = "" +
"赤=人口減
青=人口増
黒=H7年には人が住んでいたがH27時0人" +
"";
var mesh500Detail2 =
"" +
"" +
"
" +
"強度:" +
" 色:" +
"" +
"
";
function Mesh500_(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "500Mメッシュ人口(MVT)";
this.name = "mesh500";
this.origin = "e-Stat";
this.detail = "";
this.detail2 = mesh500Detail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/500mesh_plus/{z}/{x}/{y}.mvt")
});
this.maxResolution = 1222.99;//ズーム7
//this.maxResolution = 152.87;//ズーム10
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":1000},
"year":{"val":"h27"}
};
this.style = H_MVT.mesh500CommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.mesh500CommonStyleFunction;
}
H_MVT.mesh500_1 = new ol.layer.VectorTile(new Mesh500_());
H_MVT.mesh500_2 = new ol.layer.VectorTile(new Mesh500_());
//500Mメッシュここまで------------------------------------------------------------------------------------------------
//500Mメッシュ推計----------------------------------------------------------------------------------------------------
H_MVT.mesh500SuikeiCommonStyleFunction = function(arguments) {
var target = arguments["target"]["val"];
var maxColor = arguments["maxColor"]["val"];
var limit = arguments["limit"]["val"];
console.log(target);
console.log(arguments);
console.log(target.indexOf("INDEX"))
var sisuuFlg = false;
if(target.indexOf("INDEX")!==-1) {
sisuuFlg = true;
}else{
sisuuFlg = false;
}
return function (feature, resolution) {
var prop = feature.getProperties();
var population = Number(prop[target]);
var val;
var d3Color = null;
var rgb,rgba;
if(sisuuFlg) {
if(population===0) {
val = 0
d3Color = d3.interpolateLab("black", "black");
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + 1.0 + ")";
}else if(population<100) {
if (population < 100 && population > 90) {
val = 0.1
} else if (population <= 90 && population > 80) {
val = 0.2
} else if (population <= 80 && population > 70) {
val = 0.3
} else if (population <= 70 && population > 60) {
val = 0.4
} else if (population <= 60 && population > 50) {
val = 0.5
} else if (population <= 50 && population > 40) {
val = 0.6
} else if (population <= 40 && population > 30) {
val = 0.7
} else if (population <= 30 && population > 20) {
val = 0.8
} else if (population <= 20 && population > 10) {
val = 0.9
} else {
val = population / 100
}
d3Color = d3.interpolateLab("aqua", "navy");
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + 0.7 + ")";
}else{
if(population===0) {
val = 0
d3Color = d3.interpolateLab("black", "black");
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + 1.0 + ")";
}else if(population >= 100 && population < 110) {
val = 0.1
}else if(population >= 110 && population < 120) {
val = 0.2
}else if(population >= 120 && population < 130) {
val = 0.3
}else if(population >= 130 && population < 140) {
val = 0.4
}else if(population >= 140 && population < 150) {
val = 0.5
}else if(population >= 150 && population < 160) {
val = 0.6
}else if(population >= 160 && population < 170) {
val = 0.7
}else if(population >= 180 && population < 190) {
val = 0.9
}else{
val = population / 100
}
d3Color = d3.interpolateLab("yellow", "red");
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + 0.7 + ")";
}
}else{
if(Number(prop[target])===0) {
val = 0;
d3Color = d3.interpolateLab("black","black");
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + 1.0 + ")";
}else{
val = population/limit;
d3Color = d3.interpolateLab("white",maxColor);
rgb = d3.rgb(d3Color(val));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + 0.7 + ")";
}
}
if (resolution < 19.11) {
//if (!val) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 0.25
})
});
} else {
//if (!val) return;
//if(val<0.1) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
var mesh500SuikeiDetail2 =
"" +
"" +
"
" +
"強度:" +
" 色:"+
"" +
" 指数のときは無効" +
"
";
function Mesh500Suikei(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "将来推計人口500mメッシュ(MVT)";
this.name = "mesh500Suikei";
this.origin = "国土数値情報";
this.detail = "指数の場合
2010年人口数を100とした場合の20XX年人口数の指数
赤色になるほど人口増↑
紺色になるほど人口減↓
真っ黒は0人";
this.detail2 = mesh500SuikeiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:14,
//url: H_CONFIG.pFunc("https://kenzkenz.github.io/250mesh_kihon/{z}/{x}/{y}.mvt")
url:H_CONFIG.tileUrl + "tile/mvt/suikei500m/{z}/{x}/{y}.mvt"
});
//this.maxResolution = 1222.99;//ズーム7
this.maxResolution = 152.87;//ズーム10
var arguments = {
"target":{"val":"POP2010"},
"maxColor":{"val":"indigo"},
"limit":{"val":1000}
};
this.style = H_MVT.mesh500SuikeiCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.mesh500SuikeiCommonStyleFunction;
}
H_MVT.mesh500Suikei_1 = new ol.layer.VectorTile(new Mesh500Suikei());
H_MVT.mesh500Suikei_2 = new ol.layer.VectorTile(new Mesh500Suikei());
//500Mメッシュ推計ここまで---------------------------------------------------------------------------------------------
//250Mメッシュ-------------------------------------------------------------------------------------------------------
H_MVT.mesh250CommonStyleFunction = function(arguments) {
var target = arguments["target"];
var maxColor = arguments["maxColor"]["val"];
var limit = arguments["limit"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var prop = feature.getProperties();
var population = Number(prop[target]);
var val = population/limit;
var rgb = d3.rgb(d3Color(val));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
//var text = prop[year];
if (resolution < 19.11) {
//if (!val) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 0.25
})
});
} else {
//if (!val) return;
if(val<0.1) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
var mesh250Detail2 =
"" +
"強度:" +
" 色:"+
"" +
"
";
function Mesh250Kihon(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H27年250Mメッシュ人口(MVT)";
this.name = "mesh250kihon";
this.origin = "e-Stat";
this.detail = "";
this.detail2 = mesh250Detail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/250mesh_kihon/{z}/{x}/{y}.mvt")
});
this.maxResolution = 1222.99;//ズーム7
//this.maxResolution = 152.87;//ズーム10
var arguments = {
"target":"T000876001",
"maxColor":{"val":"indigo"},
"limit":{"val":1000}
};
this.style = H_MVT.mesh250CommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.mesh250CommonStyleFunction;
}
H_MVT.mesh250kihon_1 = new ol.layer.VectorTile(new Mesh250Kihon());
H_MVT.mesh250kihon_2 = new ol.layer.VectorTile(new Mesh250Kihon());
//-------------------------
function Mesh250H22(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "テストH22年250Mメッシュ人口(MVT)";
this.name = "mesh250h22";
this.origin = "e-Stat";
this.detail = "";
this.detail2 = mesh250Detail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/250mesh_h22/{z}/{x}/{y}.mvt")
});
this.maxResolution = 1222.99;//ズーム7
//this.maxResolution = 152.87;//ズーム10
var arguments = {
"target":"T000649001",
"maxColor":{"val":"indigo"},
"limit":{"val":1000}
};
this.style = H_MVT.mesh250CommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.mesh250CommonStyleFunction;
}
H_MVT.mesh250H22_1 = new ol.layer.VectorTile(new Mesh250H22());
H_MVT.mesh250H22_2 = new ol.layer.VectorTile(new Mesh250H22());
//250Mメッシュここまで------------------------------------------------------------------------------------------------
//H26経済センサス----------------------------------------------------------------------------------------------------
H_MVT.keizaiCensusStyleFunction = function(arguments) {
var maxColor = arguments["maxColor"]["val"];
var limit = arguments["limit"]["val"];
var column = arguments["column"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var prop = feature.getProperties();
var val = prop[column];
if(val==="-" || !val) return;
//if(prop["JIGYOSHO"]===0) return;
val = val / (prop["AREA"]/1000000) / limit;
//if(val<0.05) return;
if (val > 1) val = 1;
var rgb = d3.rgb(d3Color(val));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
if(prop["JIGYOSHO"]===0) {
rgba = "rgba(255,255,255,0.05)";
}
if (resolution < 125.87) {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
if(val<0.05) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
var keizaiCensusDetail1 ="事業所数、従業員数を小地域の面積で割って色を塗っています。強度をあげると色を塗る基準の上限が上がります。";
var keizaiCensusDetail2 =
"" +
"事業所:" +
"
" +
"事業者:" +
"
" +
" 強度:" +
" 色:"+
"" +
"
";
function keizaiCensus(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H26経済センサス(MVT)";
this.name = "keizaicensus";
this.origin = "e-Stat";
this.detail = keizaiCensusDetail1;
this.detail2 = keizaiCensusDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/h26keizai_census_sangyoubetu_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 1222.99;//ズーム7
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":1000},
"column":{"val":"T000843001"}
};
this.style = H_MVT.keizaiCensusStyleFunction(arguments);
this.myStyleFunction = H_MVT.keizaiCensusStyleFunction;
}
H_MVT.keizaiCensus_1 = new ol.layer.VectorTile(new keizaiCensus());
H_MVT.keizaiCensus_2 = new ol.layer.VectorTile(new keizaiCensus());
//H26経済センサスここまで----------------------------------------------------------------------------------------------
//市町村+現役世代率--------------------------------------------------------------------------------------------------
H_MVT.cityGenekiCommonStyleFunction = function(arguments) {
var year = arguments["year"]["val"];
var colorChart = arguments["colorChart"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white","red");
var prop = feature.getProperties();
var target = "genekiritu" + year;
var ritu = Number(prop[target]);
if(colorChart==="normal"){
if(isNaN(ritu)) return;
if(ritu>=1.0) {
var rgba = "rgba(139,0,0,0.8)"
}else if(ritu>=0.8) {
var rgba = "rgba(255,0,0,0.8)"
}else if(ritu>=0.6) {
var rgba = "rgba(255,165,0,0.8)"
}else if(ritu>=0.4) {
var rgba = "rgba(255,255,0,0.8)"
}else if(ritu>=0.3) {
var rgba = "rgba(0,128,0,0.8)"
}else{
var rgba = "rgba(0,0,250,0.8)"
}
}else{//無段階
//rgba = d3Color(ritu)
if(isNaN(ritu)) return;
var rgb = d3.rgb(d3Color(ritu));
//if(val>1) val = 1;
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0.8 )";
}
if (resolution < 2445.98) {
//if (!val) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
//if (!val) return;
//if(val<0.05) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
var cityGenekiDetail = "現役世代負担率=
20〜64歳に対する65歳以上人口の割合
" +
"・赤=1.0以上 高負担
" +
"・赤=0.8以上
" +
"・橙=0.6以上
" +
"・黄=0.4以上
" +
"・緑=0.3以上
" +
"・青=0.3未満 低負担
";
var cityGenekiDetail2 =
"" +
"
" +
" 年:" +
"" +
"
" +
"
" +
"
" +
"" +
"
" +
"
";
function cityGeneki(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "市町村現役世代率(MVT)";
this.name = "genekiritu";
this.origin = "resas";
this.detail = cityGenekiDetail;
this.detail2 = cityGenekiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/shicyouson_mvt/{z}/{x}/{y}.mvt")
});
var arguments = {
"year":{"val":"2015"},
"colorChart":{"val":"normal"}
};
this.style = H_MVT.cityGenekiCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.cityGenekiCommonStyleFunction;
}
H_MVT.cityGeneki_1 = new ol.layer.VectorTile(new cityGeneki());
H_MVT.cityGeneki_2 = new ol.layer.VectorTile(new cityGeneki());
//市町村+現役世代率ここまで-------------------------------------------------------------------------------------------
//市町村+財政力指数--------------------------------------------------------------------------------------------------
H_MVT.cityZaiseiCommonStyleFunction = function(arguments) {
var year = arguments["year"]["val"];
var colorChart = arguments["colorChart"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white","navy");
var prop = feature.getProperties();
var target = year;
var ritu = Number(prop[target]);
if(colorChart==="normal"){
if(isNaN(ritu)) return;
if(ritu>=1.0) {
var rgba = "rgba(0,0,250,0.8)"//ブルー
}else if(ritu>=0.8) {
var rgba = "rgba(0,128,0,0.8)"//グリーン
}else if(ritu>=0.6) {
var rgba = "rgba(255,255,0,0.8)"//イエロー
}else if(ritu>=0.4) {
var rgba = "rgba(255,165,0,0.8)"//オレンジ
}else if(ritu>=0.3) {
var rgba = "rgba(255,0,0,0.8)"//レッド
}else{
var rgba = "rgba(139,0,0,0.8)"//ダークレッド
}
}else{//無段階
//rgba = d3Color(ritu)
if(isNaN(ritu)) return;
var rgb = d3.rgb(d3Color(ritu));
//if(val>1) val = 1;
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0.8 )";
}
if (resolution < 2445.98) {
//if (!val) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
//if (!val) return;
//if(val<0.05) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
var cityZaiseiDetail = "財政力指数=
基準財政収入額を基準財政需要学で除した数値
" +
"・青=1.0以上 余裕あり
" +
"・緑=0.8以上
" +
"・黄=0.6以上
" +
"・橙=0.4以上
" +
"・赤=0.3以上
" +
"・赤=0.3未満
";
var cityZaiseiDetail2 =
"" +
"
" +
" 年:" +
"" +
"
" +
"
" +
"
" +
"" +
"
" +
"
";
function cityZaisei(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "市町村財政力指数(MVT)";
this.name = "zaiseiryoku";
this.origin = "経済・財政と暮らしの指標「見える化」データベース";
this.detail = cityZaiseiDetail;
this.detail2 = cityZaiseiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/zaiseisuii_mvt/{z}/{x}/{y}.mvt")
});
var arguments = {
"year":{"val":"2015_1"},
"colorChart":{"val":"normal"}
};
this.style = H_MVT.cityZaiseiCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.cityZaiseiCommonStyleFunction;
}
H_MVT.cityZaisei_1 = new ol.layer.VectorTile(new cityZaisei());
H_MVT.cityZaisei_2 = new ol.layer.VectorTile(new cityZaisei());
//市町村+財政力指数ここまで--------------------------------------------------------------------------------------------
//H26商業統計_500Mメッシュ--------------------------------------------------------------------------------------------
H_MVT.syougyouMeshCommonStyleFunction = function(arguments) {
var maxColor = arguments["maxColor"]["val"];
var limit = arguments["limit"]["val"];
var column = arguments["column"]["val"];
return function (feature, resolution) {
var d3Color = d3.interpolateLab("white",maxColor);
var prop = feature.getProperties();
if(column==="h99") {//比較
}else{//通常
var val = prop[column];
if(!val) return;
if(val==="X") return;
if(val==="-") return;
val = val / limit;
//if(val<0.05) return;
if (val > 1) val = 1;
var rgb = d3.rgb(d3Color(val));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + val * 0.9 + ")";
}
//var text = prop[year];
if (resolution < 19.11) {
//if (!val) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
//if (!val) return;
if(val<0.05) return;
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
};
var syougyou500mOrigin = "平成26年商業統計メッシュデータ 500mメッシュデータ";
syougyou500mOrigin += "
500mメッシュファイル フォーマット情報";
var syougyou500mDetail2 =
"" +
"" +
"
" +
"実数÷" +
" 色:"+
"" +
"
";
function Syougyou500m(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H26商業統計_500Mメッシュ(MVT)";
this.name = "syougyou500m";
this.origin = syougyou500mOrigin;
this.detail = "";
this.detail2 = syougyou500mDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/syougyou500m_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 1222.99;//ズーム7
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":1},
"column":{"val":"s23"}
};
this.style = H_MVT.syougyouMeshCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syougyouMeshCommonStyleFunction;
}
H_MVT.syougyou500m_1 = new ol.layer.VectorTile(new Syougyou500m());
H_MVT.syougyou500m_2 = new ol.layer.VectorTile(new Syougyou500m());
//H26商業統計_500Mメッシュここまで-------------------------------------------------------------------------------------
//H26商業統計_1kmメッシュ_産業別---------------------------------------------------------------------------------------
var syougyou1000m_s_Origin = "平成26年商業統計メッシュデータ 1kmメッシュデータ 産業別";
syougyou1000m_s_Origin += "
産業分類別ファイル フォーマット情報";
var syougyou1000m_s_Detail2 =
"" +
"" +
"
" +
"実数÷" +
" 色:"+
"" +
"
";
function syougyou1000m_s(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H26商業統計_1kmメッシュ_産業別(MVT)";
this.name = "syougyou1000m";
this.origin = syougyou1000m_s_Origin;
this.detail = "";
this.detail2 = syougyou1000m_s_Detail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/syougyou1km_sangyou_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 2445.98;//ズーム6
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":1},
"column":{"val":"s22"}
};
this.style = H_MVT.syougyouMeshCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syougyouMeshCommonStyleFunction;
}
H_MVT.syougyou1000m_s_1 = new ol.layer.VectorTile(new syougyou1000m_s());
H_MVT.syougyou1000m_s_2 = new ol.layer.VectorTile(new syougyou1000m_s());
//H26商業統計_1kmメッシュ_産業別ここまで--------------------------------------------------------------------------------
//H26商業統計_1kmメッシュ_業態別---------------------------------------------------------------------------------------
var syougyou1000m_g_Origin = "平成26年商業統計メッシュデータ 1kmメッシュデータ 業態別";
syougyou1000m_g_Origin += "
業態別ファイル フォーマット情報";
var syougyou1000m_g_Detail2 =
"" +
"" +
"
" +
"実数÷" +
" 色:"+
"" +
"
";
function syougyou1000m_g(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H26商業統計_1kmメッシュ_業態別(MVT)";
this.name = "syougyou1000mGyoutai";
this.origin = syougyou1000m_g_Origin;
this.detail = "";
this.detail2 = syougyou1000m_g_Detail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/syougyou1km_gyoutai_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 2445.98;//ズーム6
//this.style = H_MVT.syougyouMeshCommonStyleFunction("indigo",1,"g22");
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":1},
"column":{"val":"g22"}
};
this.style = H_MVT.syougyouMeshCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syougyouMeshCommonStyleFunction;
}
H_MVT.syougyou1000m_g_1 = new ol.layer.VectorTile(new syougyou1000m_g());
H_MVT.syougyou1000m_g_2 = new ol.layer.VectorTile(new syougyou1000m_g());
//H26商業統計_1kmメッシュ_業態別ここまで--------------------------------------------------------------------------------
//H26商業統計_1kmメッシュ_規模別---------------------------------------------------------------------------------------
var syougyou1000m_k_Origin = "平成26年商業統計メッシュデータ 1kmメッシュデータ 規模別";
syougyou1000m_k_Origin += "
規模別ファイル フォーマット情報";
var syougyou1000m_k_Detail2 =
"" +
"" +
"
" +
"実数÷" +
" 色:"+
"" +
"
";
function syougyou1000m_k(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "H26商業統計_1kmメッシュ_規模別(MVT)";
this.name = "syougyou1000mKibo";
this.origin = syougyou1000m_k_Origin;
this.detail = "";
this.detail2 = syougyou1000m_k_Detail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/syougyou1km_kibo_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 2445.98;//ズーム6
//this.style = H_MVT.syougyouMeshCommonStyleFunction("indigo",1,"k22");
var arguments = {
"maxColor":{"val":"indigo"},
"limit":{"val":1},
"column":{"val":"k22"}
};
this.style = H_MVT.syougyouMeshCommonStyleFunction(arguments);
this.myStyleFunction = H_MVT.syougyouMeshCommonStyleFunction;
}
H_MVT.syougyou1000m_k_1 = new ol.layer.VectorTile(new syougyou1000m_k());
H_MVT.syougyou1000m_k_2 = new ol.layer.VectorTile(new syougyou1000m_k());
//H26商業統計_1kmメッシュ_規模別ここまで--------------------------------------------------------------------------------
//将来推計人口1kmメッシュ----------------------------------------------------------------------------------------------
var suikei1000mOrigin = "・国土数値情報(国交省)";
// suikei1000mOrigin += "
・人口関係参考資料(国交省)";
// suikei1000mOrigin += "
・試算方法について(国交省)";
suikei1000mOrigin += "
・人口関係参考資料(国交省)";
suikei1000mOrigin += "
・試算方法について(国交省)";
var suikei1000mDetail1 =
"2050年の人口増減状況
(2010年との比較)
" +
"・青=非居住地化
" +
"・緑=50%以上100%未満減少
" +
"・黄=0%以上50%未満減少
" +
"・赤=増加
";
var suikei1000mDetail2 = "";
function suikei1000m(){
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "将来推計人口1kmメッシュ(MVT)";
this.name = "suikei1000m";
this.origin = suikei1000mOrigin;
this.detail = suikei1000mDetail1;
this.detail2 = suikei1000mDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/suikei1km_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 4891.97;//ズーム5
this.style = suikeiMeshCommonStyleFunction("2050zougen");
}
function suikeiMeshCommonStyleFunction(target) {
return function (feature, resolution) {
var prop = feature.getProperties();
var ritu = prop["INDEXHOSEI"]/100;//補正有りの方で 国の資料も補正有りで作っているようだったので
var rgba = "rgba(0,0,250,0.8)";//ブルー
switch (target) {
case "2050zougen":
var ritu2 = 1 - ritu;
if(ritu2===1) {
rgba = "rgba(0,0,250,0.8)"//ブルー
}else if(ritu2>=0.5){
rgba = "rgba(0,128,0,0.8)"//グリーン
}else if(ritu2>=0) {
rgba = "rgba(255,255,0,0.8)"//イエロー
}else{
rgba = "rgba(255,0,0,0.8)"//レッド
}
break;
default :
}
if (resolution < 152.87) {//ズーム10
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "darkgray",
width: 1
})
});
} else {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
}
return style;
}
}
H_MVT.suikei1000m_1 = new ol.layer.VectorTile(new suikei1000m());
H_MVT.suikei1000m_2 = new ol.layer.VectorTile(new suikei1000m());
//将来推計人口1kmメッシュここまで---------------------------------------------------------------------------------------
//国指定文化財等データベース-------------------------------------------------------------------------------------------
function bunkatyoudb(){
this.folder = "child";
this.category = "isekibunkazai";
this.icon = "";
this.title = "国指定文化財等データベース(MVT)";
this.name = "bunkatyoudb";
this.origin = "国指定文化財等データベース";
this.detail = "文化庁のデータベースからcsvを取得しました。";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:17,
url: H_CONFIG.tileUrl + "tile/mvt/bunkatyoudb/{z}/{x}/{y}.mvt"
});
this.style = bunkatyoudbStyleFunction;
}
function bunkatyoudbStyleFunction(feature, resolution) {
if(resolution>611.5) return;
var prop = feature.getProperties();
if(resolution>305) {
var pointRadius = 2;
}else if(resolution>152) {
var pointRadius = 4;
}else if(resolution>76) {
var pointRadius = 4;
}else if(resolution>38) {
var pointRadius = 4;
}else{
var pointRadius = 6;
}
var text = "";
if(resolution<9.55) {
text = prop["名称"];
}
var fillColor = "blue";
var category = prop["文化財種類"];
switch (category) {
case "国宝・重要文化財(建造物)":
fillColor = "magenta";
break;
}
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:pointRadius,
fill: new ol.style.Fill({
color:fillColor
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
return style;
}
H_MVT.bunkatyoudb1 = new ol.layer.VectorTile(new bunkatyoudb());
H_MVT.bunkatyoudb2 = new ol.layer.VectorTile(new bunkatyoudb());
//国指定文化財等データベースここまで------------------------------------------------------------------------------------
//全国博物館--------------------------------------------------------------------------------------------------------
function zenkokuHakubutukan(){
this.folder = "child";
this.category = "isekibunkazai";
this.icon = "";
this.title = "全国博物館等(MVT)test";
this.name = "zenkokuhakubutukan";
this.origin = "saveMLAK Community";
this.detail = "博物館・美術館、図書館、文書館、公民館の情報です。";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:17,
url: H_CONFIG.tileUrl + "tile/mvt/iseki/hakubutukan/{z}/{x}/{y}.mvt"
});
this.style = zenkokuhakubutukanStyleFunction;
}
function zenkokuhakubutukanStyleFunction(feature, resolution) {
if(resolution>1222) return;
var prop = feature.getProperties();
if(resolution>305) {
var pointRadius = 2;
}else if(resolution>152) {
var pointRadius = 4;
}else if(resolution>76) {
var pointRadius = 4;
}else if(resolution>38) {
var pointRadius = 4;
}else{
var pointRadius = 6;
}
var text = "";
if(resolution<19.11) {
text = prop["name"];
}
var fillColor = "blue";
var name = prop["name"];
if(name.indexOf("博物館")!==-1) {
fillColor = "red";
}else if(name.indexOf("美術館")!==-1){
fillColor = "red";
}else if(name.indexOf("図書館")!==-1){
fillColor = "green";
}
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:pointRadius,
fill: new ol.style.Fill({
color:fillColor
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
return style;
}
H_MVT.zenkokuHakubutukan1 = new ol.layer.VectorTile(new zenkokuHakubutukan());
H_MVT.zenkokuHakubutukan2 = new ol.layer.VectorTile(new zenkokuHakubutukan());
//全国博物館ここまで-------------------------------------------------------------------------------------------------
//全国文化財---------------------------------------------------------------------------------------------------------
function bunkazai(){
this.folder = "child";
this.category = "isekibunkazai";
this.icon = "";
this.title = "全国文化財(MVT)test";
this.name = "bunkazai";
this.origin = "";
this.detail = "";
this.detail2 = "" +
"種類小区分選択:" +
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/bunkazai/{z}/{x}/{y}.mvt"
});
this.maxResolution = 1222.99;
this.style = bunkazaiStyleFunction;
}
var syoukubunTarget = "0";
function bunkazaiStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var targetId005 = prop["P32_005"];
var syoukubunArFilter = syoukubunAr.filter(function (item,index) {
if(item.id==targetId005) return true;
});
if(syoukubunTarget=="0" || syoukubunTarget==targetId005) {
}else{
return;
}
var fillColor = syoukubunArFilter[0]["color"];
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:8,
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({color: "white", width: 1})
})
});
return style;
}
H_MVT.bunkazai1 = new ol.layer.VectorTile(new bunkazai());
H_MVT.bunkazai2 = new ol.layer.VectorTile(new bunkazai());
//全国文化財ここまで--------------------------------------------------------------------------------------------------
//全国旧石器時代遺跡--------------------------------------------------------------------------------------------------
//var kyuusekkiTarget = "0";
H_MVT.zenkokuisekiStyleFunction = function(target) {
return function (feature, resolution) {
var prop = feature.getProperties();
if (resolution > 305) {
var pointRadius = 2;
} else if (resolution > 152) {
var pointRadius = 4;
} else if (resolution > 76) {
var pointRadius = 4;
} else if (resolution > 38) {
var pointRadius = 4;
} else {
var pointRadius = 6;
}
var text = "";
if (resolution < 19.11) {
text = prop["遺跡名"];
}
var fillColor = "red";
if (target === "all") {
if (resolution > 1222) return;
} else {
if (prop[target]) {
fillColor = "blue";
} else {
return;
}
}
var style = new ol.style.Style({
image: new ol.style.Circle({
radius: pointRadius,
fill: new ol.style.Fill({
color: fillColor
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
return style;
}
};
function zenkokuIseki() {
this.folder = "child";
this.category = "isekibunkazai";
this.icon = "";
this.title = "全国旧石器時代遺跡(MVT)";
this.name = "zenkokukyuusekki";
this.origin = "データベース『日本列島の旧石器時代遺跡』の全国版遺跡データ(csv)";
this.detail = "日本旧石器学会 ";
this.detail2 = "" +
"石器種類:" +
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:17,
url: H_CONFIG.tileUrl + "tile/mvt/iseki/zenkoku/{z}/{x}/{y}.mvt"
});
this.style = H_MVT.zenkokuisekiStyleFunction("all")
}
H_MVT.zenkokuIseki1 = new ol.layer.VectorTile(new zenkokuIseki());
H_MVT.zenkokuIseki2 = new ol.layer.VectorTile(new zenkokuIseki());
//全国旧石器時代遺跡ここまで--------------------------------------------------------------------------------------------
//全国縄文・弥生集落---------------------------------------------------------------------------------------------------
function yayoi(){
this.folder = "child";
this.category = "isekibunkazai";
this.icon = "";
this.title = "全国縄文・弥生集落遺跡(MVT)";
this.name = "zenkokuzyoumonyayoi";
this.origin = "縄文・弥生集落遺跡データベース";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/iseki/yoyoi/{z}/{x}/{y}.mvt"
});
this.style = yayoiStyleFunction;
}
var yayoiTarget = "0";
function yayoiStyleFunction(feature, resolution) {
var prop = feature.getProperties();
if(resolution>305) {
var pointRadius = 2;
}else if(resolution>152) {
var pointRadius = 4;
}else if(resolution>76) {
var pointRadius = 4;
}else if(resolution>38) {
var pointRadius = 4;
}else{
var pointRadius = 6;
}
var text = "";
if(resolution<19.11) {
text = prop["遺跡名"].split(" ")[0];
}
var fillColor = "darkgreen";
if(yayoiTarget === "0") {
if (resolution > 1222) return;
}else{
if(prop[yayoiTarget]) {
fillColor = "blue";
}else{
return;
}
}
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:pointRadius,
fill: new ol.style.Fill({
color:fillColor
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
return style;
}
H_MVT.yayoi1 = new ol.layer.VectorTile(new yayoi());
H_MVT.yayoi2 = new ol.layer.VectorTile(new yayoi());
//全国縄文・弥生集落ここまで--------------------------------------------------------------------------------------------
//熊本県遺跡---------------------------------------------------------------------------------------------------------
function kumamotoIseki(){
this.folder = "child";
this.category = "isekibunkazai";
this.icon = "";
this.title = "熊本県遺跡(MVT)";
this.name = "kumamoto";
this.origin = "";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:17,
url: H_CONFIG.tileUrl + "tile/mvt/iseki/kumamotoken/{z}/{x}/{y}.mvt"
});
this.style = kumamotoStyleFunction
}
function kumamotoStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var geoType = feature.getGeometry().getType();
//var fillColor = prop["_fillColor"];
if(resolution>2445) {//ズーム6
var pointRadius = 2;
}else if(resolution>1222) {//ズーム7
var pointRadius = 2;
}else if(resolution>611){
var pointRadius = 2;
}else if(resolution>305) {
var pointRadius = 2;
}else if(resolution>152) {
var pointRadius = 2;
}else if(resolution>76) {
var pointRadius = 2;
}else if(resolution>38) {
var pointRadius = 4;
}else{
var pointRadius = 6;
}
var text = "";
if(resolution<4.78) {
if(prop["m_cont2"]) {
text = prop["m_cont2"];
}else{
text = prop["ITM02_VAL"];
}
}
switch (geoType){
case "MultiLineString":
case "LineString":
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
color:"red",
width:1
})
});
break;
case "MultiPoint":
case "Point":
if(resolution>305) break;
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:pointRadius,
fill: new ol.style.Fill({
color:"orange"
}),
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
break;
case "Polygon":
case "MultiPolygon":
if(resolution<76) {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color:"rgba(0,128,0,0.8)"
}),
stroke: new ol.style.Stroke({
color: "gray",
width: 1
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
}),
zIndex: 0
});
}else{
var style = new ol.style.Style({
fill: new ol.style.Fill({
color:"rgba(0,128,0,1.0)"
}),
zIndex: 0
});
}
break;
default:
}
return style;
}
H_MVT.kumamotoIseki1 = new ol.layer.VectorTile(new kumamotoIseki());
H_MVT.kumamotoIseki2 = new ol.layer.VectorTile(new kumamotoIseki());
//熊本県遺跡ここまで---------------------------------------------------------------------------------------------------
//福井県林道----------------------------------------------------------------------------------------------------------
H_MVT.fukuiRindou1 = new ol.layer.VectorTile({
folder:"child",
category:"test",
icon:"",
title:"福井県林道(MVT)",
name:"fukuirindou",
origin:"",
detail:"",
source: new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/fukuiken/rindou/{z}/{x}/{y}.mvt"
}),
style: fukuiRindouStyleFunction
});
function fukuiRindouStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var fillColor = "black";
if(prop["type"]==="r") {
fillColor = "red"
}else{
fillColor = "blue"
}
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
color:fillColor,
width: 2
})
});
return style;
}
//福井県林道ここまで--------------------------------------------------------------------------------------------------
//宮崎県津波浸水------------------------------------------------------------------------------------------------------
H_MVT.tunamiMiyazakiStyleFunction = function (target) {
return function (feature, resolution) {
if(target==="ao") {
var sinsuiColor = d3.interpolateLab("white", "navy");
}else{
var sinsuiColor = d3.interpolateLab("white", "darkred");
}
var prop = feature.getProperties();
if (prop["H_M"]) {
var level = prop["H_M"];
if(target==="normal") {
if (level < 0.3) {
fillColor = "rgba(0,255,0,0.7)";
} else if (level < 1) {
fillColor = "rgba(255,230,0,0.7)";
} else if (level < 2) {
fillColor = "rgba(255,153,0,0.7)";
} else if (level < 5) {
fillColor = "rgba(239,117,152,0.7)";
} else if (level < 10) {
fillColor = "rgba(255,40,0,0.7)";
} else if (level < 20) {
fillColor = "rgba(180,0,104,0.7)";
} else {
fillColor = "rgba(128,0,255,0.7)";
}
}else {
fillColor = sinsuiColor(level / 10);
}
} else {
var level = prop["level"];
if(target==="normal") {
switch (level) {
case 1://0.3
fillColor = "rgba(0,255,0,0.7)";
break;
case 2://1
fillColor = "rgba(255,230,0,0.7)";
break;
case 3://2
fillColor = "rgba(255,153,0,0.7)";
break;
case 4://2〜5
fillColor = "rgba(239,117,152,0.7)";
break;
case 5://10
fillColor = "rgba(255,40,0,0.7)";
break;
case 6://20
fillColor = "rgba(180,0,104,0.7)";
break;
case 7:
fillColor = "rgba(128,0,255,0.7)";
break;
}
}else {
switch (level) {
case 1://0.3
level = 0.3;
break;
case 2://1
level = 1;
break;
case 3://2
level = 2;
break;
case 4://2〜5
level = 5;
break;
case 5://10
level = 10;
break;
case 6://20
level = 20;
break;
case 7:
level = 30;
break;
}
fillColor = sinsuiColor(level / 10);
}
}
var text = "";
if(resolution<0.30) {
text = String(prop["H_M"]) + "M";
}
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: fillColor
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
exceedLength:true
})
});
return style;
}
};
var tunamiDetail2 =
"" +
" 塗り分け選択:"+
"" +
"
";
H_MVT.tunamimiyazakimvt1 = new ol.layer.VectorTile({
folder:"child",
category:"chonai",
title:"宮崎県津波浸水10Mメッシュ(MVT)",
name:"tunamimiyazaki",
origin:"",
detail:"",
detail2:tunamiDetail2,
icon:"",
source: new ol.source.VectorTile({
overlaps:false,
format: new ol.format.MVT(),
maxZoom:19,
url: H_CONFIG.tileUrl + "tile/mvt/tunamimiyazaki/{z}/{x}/{y}.mvt"
}),
crossOrigin:"anonymous",
style: H_MVT.tunamiMiyazakiStyleFunction("normal")
});
function tunamimvt(){
this.folder = "child";
this.category = "hazard";
this.title = "津波浸水想定区域(宮崎県)(MVT)";
this.name = "tunamimvt";
this.origin = "";
this.detail = "";
this.icon = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:18,
url: H_CONFIG.tileUrl + "tile/mvt/tunami/{z}/{x}/{y}.mvt"
});
this.crossOrigin = "anonymous";
this.style = tunamiStyleFunction;
}
function tunamiStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var level = prop["level"];
var fillColor = "black";
switch (level) {
case 1:
fillColor = "rgba(0,255,0,0.7)";
break;
case 2:
fillColor = "rgba(255,230,0,0.7)";
break;
case 3:
fillColor = "rgba(255,153,0,0.7)";
break;
case 4:
fillColor = "rgba(239,117,152,0.7)";
break;
case 5:
fillColor = "rgba(255,40,0,0.7)";
break;
case 6:
fillColor = "rgba(180,0,104,0.7)";
break;
case 7:
fillColor = "rgba(128,0,255,0.7)";
break;
}
var style = new ol.style.Style({
fill: new ol.style.Fill({
color:fillColor
})
});
return style;
}
H_MVT.tunamimvt1 = new ol.layer.VectorTile(new tunamimvt());
H_MVT.tunamimvt2 = new ol.layer.VectorTile(new tunamimvt());
//宮崎県津波浸水ここまで----------------------------------------------------------------------------------------------
//北海道津波浸水------------------------------------------------------------------------------------------------------
H_MVT.tunamiHokkaidouStyleFunction = function(arguments) {
var target = arguments["target"]["val"];
var column = arguments["column"]["val"];
return function (feature, resolution) {
var zoom = H_COMMON.zoomForResolution(resolution);
if(target==="ao") {
var sinsuiColor = d3.interpolateLab("white", "navy");
}else{
var sinsuiColor = d3.interpolateLab("white", "darkred");
}
var prop = feature.getProperties();
if (prop[column]) {
var level = prop[column];
// if (prop["MAX_SIN"]) {
// var level = prop["MAX_SIN"];
if(target==="normal") {
if (level < 0.3) {
fillColor = "rgba(0,255,0,0.7)";
} else if (level < 1) {
fillColor = "rgba(255,230,0,0.7)";
} else if (level < 2) {
fillColor = "rgba(255,153,0,0.7)";
} else if (level < 5) {
fillColor = "rgba(239,117,152,0.7)";
} else if (level < 10) {
fillColor = "rgba(255,40,0,0.7)";
} else if (level < 20) {
fillColor = "rgba(180,0,104,0.7)";
} else {
fillColor = "rgba(128,0,255,0.7)";
}
}else {
fillColor = sinsuiColor(level / 10);
}
if (zoom>=18) {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({
color: "black",
width: 1
})
});
}else{
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: fillColor
})
});
}
} else {
var level = prop["level"];
if(target==="normal") {
switch (level) {
case 1://0.3
fillColor = "rgba(0,255,0,0.7)";
break;
case 2://1
fillColor = "rgba(255,230,0,0.7)";
break;
case 3://2
fillColor = "rgba(255,153,0,0.7)";
break;
case 4://2〜5
fillColor = "rgba(239,117,152,0.7)";
break;
case 5://10
fillColor = "rgba(255,40,0,0.7)";
break;
case 6://20
fillColor = "rgba(180,0,104,0.7)";
break;
case 7:
fillColor = "rgba(128,0,255,0.7)";
break;
}
}else {
switch (level) {
case 1://0.3
level = 0.3;
break;
case 2://1
level = 1;
break;
case 3://2
level = 2;
break;
case 4://2〜5
level = 5;
break;
case 5://10
level = 10;
break;
case 6://20
level = 20;
break;
case 7:
level = 30;
break;
}
fillColor = sinsuiColor(level / 10);
}
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: fillColor
})
});
}
// var style = new ol.style.Style({
// fill: new ol.style.Fill({
// color: fillColor
// })
// });
return style;
}
};
var hokkaidoutunamiDetail2 =
"" +
" 塗り分け選択:"+
"" +
"
";
//日本海側-----------------------------------------------------------------------------------------------------------
function TunamiHokkaidoNihonkai(){
this.folder="child";
this.category="hazard";
this.title="北海道日本海沿岸の津波浸水想定(MVT)";
this.name="tunamihokkaidou";
this.origin="北海道日本海沿岸の津波浸水想定の公表について";
this.detail="";
this.detail2=hokkaidoutunamiDetail2;
this.icon="";
this.source=new ol.source.VectorTile({
overlaps:false,
transition:0,
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/hokkaido_tunami/{z}/{x}/{y}.mvt")
});
var arguments = {
"target":{"val":"normal"},
"column":{"val":"MAX_SIN"}
};
this.style=H_MVT.tunamiHokkaidouStyleFunction(arguments);
this.myStyleFunction = H_MVT.tunamiHokkaidouStyleFunction;
}
H_MVT.tunamihokkaidou_1 = new ol.layer.VectorTile(new TunamiHokkaidoNihonkai());
H_MVT.tunamihokkaidou_2 = new ol.layer.VectorTile(new TunamiHokkaidoNihonkai());
//太平洋側-----------------------------------------------------------------------------------------------------------
function TunamiHokkaidoTaiheiyou(){
this.folder="child";
this.category="hazard";
this.title="北海道太平洋沿岸の津波浸水想定(MVT)";
this.name="tunamihokkaidouTaiheiyou";
this.origin="北海道防災情報 津波浸水結果GIS情報";
this.detail="";
this.detail2=hokkaidoutunamiDetail2;
this.icon="";
this.source=new ol.source.VectorTile({
overlaps:false,
transition:0,
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/hokkaido_tunami_t/{z}/{x}/{y}.mvt")
});
var arguments = {
"target":{"val":"normal"},
"column":{"val":"max"}
};
this.style=H_MVT.tunamiHokkaidouStyleFunction(arguments);
this.myStyleFunction = H_MVT.tunamiHokkaidouStyleFunction;
}
H_MVT.tunamihokkaidou_t_1 = new ol.layer.VectorTile(new TunamiHokkaidoTaiheiyou());
H_MVT.tunamihokkaidou_t_2 = new ol.layer.VectorTile(new TunamiHokkaidoTaiheiyou());
//北海道津波浸水ここまで-----------------------------------------------------------------------------------------------
//北海道森林---------------------------------------------------------------------------------------------------------
H_MVT.ringyouHokkaidouStyleFunction = function(arguments) {
var target = arguments["target"]["val"];
return function (feature, resolution) {
var prop = feature.getProperties();
var zoom = H_COMMON.zoomForResolution(resolution);
var rgba;
if(target==="樹種名"||target==="樹種1") {
switch (prop[target]) {
case "アオダモ":
rgba = "rgba(210,255,167,0.7)";
break;
case "アカエゾマツ":
rgba = "rgba(51,160,44,0.7)";
break;
case "アカトドマツ":
rgba = "rgba(176,64,250,0.7)";
break;
case "アカマツ":
rgba = "rgba(255,147,93,0.7)";
break;
case "アサダ":
rgba = "rgba(210,255,167,0.7)";
break;
case "イタヤカエデ":
rgba = "rgba(210,255,167,0.7)";
break;
case "イチイ":
rgba = "rgba(203,101,11,0.7)";
break;
case "イチョウ":
rgba = "rgba(246,190,57,0.7)";
break;
case "イヌエンジュ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ウダイカンバ(マカバ)":
rgba = "rgba(180,180,180,0.7)";
break;
case "エウロアメリカポプラ(改良ポプラ)":
rgba = "rgba(159,104,55,0.7)";
break;
case "エゾマツ":
rgba = "rgba(51,160,44,0.7)";
break;
case "オニグルミ・サワグルミ":
rgba = "rgba(210,255,167,0.7)";
break;
case "オヒョウ":
rgba = "rgba(210,255,167,0.7)";
break;
case "カエデ":
rgba = "rgba(210,255,167,0.7)";
break;
case "カシワ":
rgba = "rgba(210,255,167,0.7)";
break;
case "カツラ":
rgba = "rgba(210,255,167,0.7)";
break;
case "カラマツ":
rgba = "rgba(255,127,0,0.7)";
break;
case "キタコブシ":
rgba = "rgba(210,255,167,0.7)";
break;
case "キタゴヨウ・ゴヨウマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "キハダ":
rgba = "rgba(210,255,167,0.7)";
break;
case "キリ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ギンドロ":
rgba = "rgba(210,255,167,0.7)";
break;
case "グイマツ":
rgba = "rgba(255,127,0,0.7)";
break;
case "グイマツ雑種F1〔♀グイマツ×♂ニホンカラマツ〕":
rgba = "rgba(255,127,0,0.7)";
break;
case "クリ":
rgba = "rgba(210,255,167,0.7)";
break;
case "グルチノーザハンノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "クロマツ":
rgba = "rgba(100,100,100,0.7)";
break;
case "ケヤキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ケヤマハンノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "コナラ":
rgba = "rgba(210,255,167,0.7)";
break;
case "コバノヤマハンノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "サクラ":
rgba = "rgba(247,123,255,0.7)";
break;
case "サワシバ":
rgba = "rgba(210,255,167,0.7)";
break;
case "シウリザクラ":
rgba = "rgba(247,123,255,0.7)";
break;
case "シナノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "シラカンバ":
rgba = "rgba(180,180,180,0.7)";
break;
case "スギ":
rgba = "rgba(56,112,0,0.7)";
break;
case "ストローブマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "スーパーF1":
rgba = "rgba(255,127,0,0.7)";
break;
case "セイヨウハコヤナギ(ポプラ)":
rgba = "rgba(210,255,167,0.7)";
break;
case "その他カンバ":
rgba = "rgba(180,180,180,0.7)";
break;
case "その他人工林針葉樹":
rgba = "rgba(255,238,1,0.7)";
break;
case "ダケカンバ":
rgba = "rgba(180,180,180,0.7)";
break;
case "チョウセンカラマツ":
rgba = "rgba(255,127,0,0.7)";
break;
case "チョウセンゴヨウ":
rgba = "rgba(255,238,1,0.7)";
break;
case "トチノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "トドマツ":
rgba = "rgba(1,35,255,0.7)";
break;
case "ドロノキ(ドロヤナギ)":
rgba = "rgba(210,255,167,0.7)";
break;
case "ナナカマド":
rgba = "rgba(210,255,167,0.7)";
break;
case "ニセアカシヤ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ハクウンボク":
rgba = "rgba(210,255,167,0.7)";
break;
case "ハシドイ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ハリギリ(センノキ)":
rgba = "rgba(210,255,167,0.7)";
break;
case "ハルニレ(アカダモ)":
rgba = "rgba(210,255,167,0.7)";
break;
case "バンクスマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "ハンノキ・ヤチハンノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヒノキアスナロ(ヒバ)":
rgba = "rgba(56,112,0,0.7)";
break;
case "ブナ":
rgba = "rgba(255,123,145,0.7)";
break;
case "ホオノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ミズナラ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヤチダモ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヤナギ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヤマグワ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヤマナラシ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヤマハンノキ":
rgba = "rgba(210,255,167,0.7)";
break;
case "ヨーロッパアカマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "ヨーロッパクロマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "ヨーロッパトウヒ(ドイツトウヒ)":
rgba = "rgba(255,238,1,0.7)";
break;
case "リギダマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "レジノーザマツ":
rgba = "rgba(255,238,1,0.7)";
break;
case "":
rgba = "rgba(255,255,255,0.7)";
break;
case "針広混交林":
case "針広混交林 ":
rgba = "rgba(210,255,167,0.7)";
break;
case "人工林広葉樹":
rgba = "rgba(210,255,167,0.7)";
break;
case "天然林広葉樹":
rgba = "rgba(255,247,183,0.7)";
break;
case "天然林針葉樹":
rgba = "rgba(255,238,1,0.7)";
break;
default:
rgba = "rgba(255,255,255,0.7)";
}
}else if(target==="林齢"){
var d3Color = d3.interpolateLab("white","navy");
var rgb = d3.rgb(d3Color(prop[target]/128));
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.8)";
}
var styles = [];
var text = prop["ラベル"];
var fillStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
function strokeStyle1(width){
var strokeStyle0 = new ol.style.Style({
stroke: new ol.style.Stroke({
color: "black",
width: width
})
});
return strokeStyle0;
}
var textStyle = new ol.style.Style({
text: new ol.style.Text({
font: "10px sans-serif",
text: text,
//offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
overflow:true,
exceedLength:true,
placement:"point"
})
});
styles.push(fillStyle);
if(zoom>=15) {
styles.push(strokeStyle1(1.0));
styles.push(textStyle);
}else if(zoom>=12) {
styles.push(strokeStyle1(0.25));
}else if(zoom>=11) {
styles.push(strokeStyle1(0.1));
}
return styles;
}
};
var hokkaidouringyouDetail2 =
"" +
" 塗り分け選択:"+
"" +
"
";
function RingyouHokkaido(){
this.folder="child";
this.category="shinrin";
this.title="北海道-民有林2016";
this.name="h-minyu2016";
this.origin="北海道オープンデータカタログ";
this.detail="";
this.detail2=hokkaidouringyouDetail2;
this.icon = "";
this.source=new ol.source.VectorTile({
overlaps:false,
transition:0,
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/hokkaido_rin/{z}/{x}/{y}.mvt")
});
var arguments = {
"target":{"val":"樹種1"}
};
this.style=H_MVT.ringyouHokkaidouStyleFunction(arguments);
this.myStyleFunction = H_MVT.ringyouHokkaidouStyleFunction;
}
H_MVT.ringyouHokkaido_1 = new ol.layer.VectorTile(new RingyouHokkaido());
H_MVT.ringyouHokkaido_2 = new ol.layer.VectorTile(new RingyouHokkaido());
function RingyouHokkaido_dou(){
this.folder="child";
this.category="shinrin";
this.title="北海道-道有林2015";
this.name="h-douyu2015";
this.origin="北海道オープンデータカタログ";
this.detail="";
this.detail2=hokkaidouringyouDetail2;
this.icon = "";
this.source=new ol.source.VectorTile({
overlaps:false,
transition:0,
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/hokkaido_rin_do/{z}/{x}/{y}.mvt")
});
var arguments = {
"target":{"val":"樹種名"}
};
this.style=H_MVT.ringyouHokkaidouStyleFunction(arguments);
this.myStyleFunction = H_MVT.ringyouHokkaidouStyleFunction;
}
H_MVT.ringyouHokkaido_dou_1 = new ol.layer.VectorTile(new RingyouHokkaido_dou());
H_MVT.ringyouHokkaido_dou_2 = new ol.layer.VectorTile(new RingyouHokkaido_dou());
//北海道森林ここまで---------------------------------------------------------------------------------------------------
//避難所-------------------------------------------------------------------------------------------------------------
H_MVT.hinanzyo = new ol.layer.VectorTile({
folder:"child",
category:"hazard",
icon:"",
title:"テスト避難所(MVT)",
name:"hinanzyo",
origin:"",
detail:"",
source: new ol.source.VectorTile({
//cacheSize:10000,
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/hinanzyo_mvt/{z}/{x}/{y}.mvt")
}),
maxResolution: 305.75,
style: commonstyleFunction
});
//避難所ここまで------------------------------------------------------------------------------------------------------
//OSMMVT------------------------------------------------------------------------------------------------------------
var osmmvtDetail2 =
"" +
" バックグラウンドカラー:"+
"" +
"
";
H_MVT.osmmvt1 = new ol.layer.VectorTile({
folder:"child",
category:"test",
icon:"",
title:"osmmvt",
name:"osmmvt",
origin:"",
detail:"",
detail2:osmmvtDetail2,
source: new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:14,
url:H_CONFIG.pFunc("https://hfu.github.io/jp1710_{z}/{x}/{y}.mvt ")
})
});
//OSMMVTここまで-----------------------------------------------------------------------------------------------------
//小学校区----------------------------------------------------------------------------------------------------------
H_MVT.syougakkouku1 = new ol.layer.VectorTile(new syougakkouku());
H_MVT.syougakkouku2 = new ol.layer.VectorTile(new syougakkouku());
function syougakkouku(){
this.folder = "child";
this.category = "KosodateFukushi";
this.icon = "";
this.title = "全国小学校区(MVT)";
this.name = "syougakkouku";
this.origin = "国土数値情報 小学校区データ";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/syougakkouku/{z}/{x}/{y}.mvt"
});
this.style = syougakkoukuStyleFunction;
}
//var d3syougakkoukuColor = d3.scale.category20();
//var d3tyuugakkoukuColor = d3.scale.category20c();
var d3syougakkoukuColor = d3.scaleOrdinal(d3.schemeCategory10);
var d3tyuugakkoukuColor = d3.scaleOrdinal(d3.schemeCategory10);
function syougakkoukuStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var geoType = feature.getGeometry().getType();
var text = "";
if(resolution<38.22){
if(prop["A27_003"]) {
text = prop["A27_003"];
}else{
text = prop["A32_003"];
}
}
if(prop["A27_005"]) {
var rgb = d3.rgb(d3syougakkoukuColor(Number(prop["id"])));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.7)";
}else{
var rgb = d3.rgb(d3tyuugakkoukuColor(Number(prop["id"])));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.7)";
}
switch (geoType){
case "MultiPoint":
case "Point":
if(resolution>305) break;
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:3,
fill: new ol.style.Fill({
color:"black"
}),
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY:10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
break;
case "Polygon":
case "MultiPolygon":
if(resolution<76) {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color:rgba
}),
stroke: new ol.style.Stroke({
color: "gray",
width: 1
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
}),
zIndex: 0
});
}else{
var style = new ol.style.Style({
fill: new ol.style.Fill({
color:rgba
}),
zIndex: 0
});
}
break;
default:
}
return style;
}
//中学校区-----------------------------------------------------------------------------------------------------------
H_MVT.tyuugakkouku1 = new ol.layer.VectorTile(new tyuugakkouku());
H_MVT.tyuugakkouku2 = new ol.layer.VectorTile(new tyuugakkouku());
function tyuugakkouku(){
this.folder = "child";
this.category = "KosodateFukushi";
this.icon = "";
this.title = "全国中学校区(MVT)";
this.name = "tyuugakkouku";
this.origin = "国土数値情報 中学校区データ";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/tyuugakkouku/{z}/{x}/{y}.mvt"
});
this.style = syougakkoukuStyleFunction;
}
//小中学校区ここまで--------------------------------------------------------------------------------------------------
//二次医療圏------------------------------------------------------------------------------------------------------------
H_MVT.d3StyleFunction = function(iryoukenTarget) {
//var d3Color = d3.scale.category20();
var d3Color = d3.scaleOrdinal(d3.schemeCategory10);
var d3Color2 = d3.interpolateLab("white","red");
var d3Color3 = d3.interpolateLab("white","blue");
var d3Color4 = d3.interpolateLab("white","green");
return function(feature, resolution) {
var prop = feature.getProperties();
var geoType = feature.getGeometry().getType();
var text = "";
if (resolution < 38.22) {
//text = prop["A38b_004"];
}
switch (iryoukenTarget) {
case 0:
var rgb = d3.rgb(d3Color(Number(prop["A38b_003"])));
var bbb = Number(prop["A38b_003"].substr(0, 2));
var ccc = Number(prop["A38b_003"].substr(2, 2)) * 5;
if (rgb.b - bbb) {
var blue = rgb.b - bbb
} else {
var blue = 0
}
if (rgb.r - ccc) {
var red = rgb.r - ccc
} else {
var red = 0
}
var rgba = "rgba(" + red + "," + rgb.g + "," + blue + ",0.7)";
break;
case 1:
var souzinkou = Number(prop["A38b_008"]);
var rounen = Number(prop["A38b_011"]);
var ritu = rounen / souzinkou;
ritu = (ritu - 0.15) * 5
var rgb = d3.rgb(d3Color2(ritu));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.7)";
break;
case 2:
var souzinkou = Number(prop["A38b_008"]);
var seisan = Number(prop["A38b_010"]);
var ritu = seisan / souzinkou;
ritu = (ritu - 0.4) * 4
var rgb = d3.rgb(d3Color3(ritu));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.7)";
break;
case 3:
var souzinkou = Number(prop["A38b_008"]);
var nensyou = Number(prop["A38b_009"]);
var ritu = nensyou / souzinkou;
ritu = (ritu - 0.1) * 20
var rgb = d3.rgb(d3Color4(ritu));
var rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0.7)";
break;
}
switch (geoType) {
case "MultiPoint":
case "Point":
if (resolution > 305) break;
var style = new ol.style.Style({
image: new ol.style.Circle({
radius: 3,
fill: new ol.style.Fill({
color: "black"
}),
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
break;
case "Polygon":
case "MultiPolygon":
if (resolution < 2445.98) {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
stroke: new ol.style.Stroke({
color: "gray",
width: 1
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
}),
zIndex: 0
});
} else {
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
}),
zIndex: 0
});
}
break;
default:
}
return style;
};
};
function iryouken(){
this.folder = "child";
this.category = "KosodateFukushi";
this.icon = "";
this.title = "二次医療圏(MVT)";
this.name = "iryouken";
this.origin = "国土数値情報 医療圏データ";
this.detail = "";
this.detail2 = "" +
" 色:"+
"
";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.tileUrl + "tile/mvt/iryouken/{z}/{x}/{y}.mvt"
});
this.style = H_MVT.d3StyleFunction(0)
}
H_MVT.iryouken1 = new ol.layer.VectorTile(new iryouken());
H_MVT.iryouken2 = new ol.layer.VectorTile(new iryouken());
//二次医療圏ここまで------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
//全国福祉施設
H_MVT.fukushiStyleFunction = function(target) {
return function (feature, resolution) {
var prop = feature.getProperties();
if (resolution > 305) {
var pointRadius = 2;
} else if (resolution > 152) {
var pointRadius = 4;
} else if (resolution > 76) {
var pointRadius = 4;
} else if (resolution > 38) {
var pointRadius = 4;
} else {
var pointRadius = 6;
}
var text = "";
if (resolution < 4.78) {
text = prop["P14_007"];
}
var fillColor = "black";
var syoubunrui = prop["P14_005"];
switch (syoubunrui) {
case "19013":
case "19014":
case "19015":
case "19016":
case "19017":
case "19018":
case "19019":
case "19020":
case "19021":
case "19022":
case "19023":
case "16011"://幼稚園
fillColor = "green";
if(target!=="all") {
if(target!=="kosodate") return;
}
break;
case "19001":
case "19002":
case "19003":
case "19004":
fillColor = "red";
if(target!=="all") {
if(target!=="rouzin") return;
}
break;
default:
if(target!=="all") return;
break;
}
var style = new ol.style.Style({
image: new ol.style.Circle({
radius: pointRadius,
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
return style;
}
};
var fukusiDetail2 =
"" +
" 施設選択:"+
"" +
"
";
function fukushi_(){
this.folder = "child";
this.category = "KosodateFukushi";
this.icon = "";
this.title = "全国福祉施設(MVT)";
this.name = "fukushi";
this.origin = "";
this.detail = "";
this.detail2 = fukusiDetail2;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/h27fukushi_mvt/{z}/{x}/{y}.mvt")
});
this.maxResolution = 305.75;
this.style = H_MVT.fukushiStyleFunction("all");
}
H_MVT.fukushi_1 = new ol.layer.VectorTile(new fukushi_());
H_MVT.fukushi_2 = new ol.layer.VectorTile(new fukushi_());
//静岡県林班界--------------------------------------------------------------------------------------------------------
H_MVT.shizuokaRinhankaiStyleFunction = function() {
return function(feature, resolution) {
var prop = feature.getProperties();
var geoType = feature.getGeometry().getType();
var text = "";
switch (geoType) {
case "MultiPoint":
case "Point":
if (resolution > 305) break;
var style = new ol.style.Style({
image: new ol.style.Circle({
radius: 3,
fill: new ol.style.Fill({
color: "black"
}),
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
}),
text: new ol.style.Text({
font: "8px sans-serif",
text: text,
offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
})
})
});
break;
case "Polygon":
case "MultiPolygon":
var style = new ol.style.Style({
fill: new ol.style.Fill({
color: "rgba(200,0,0,0.6)"
}),
stroke: new ol.style.Stroke({
color: "black",
width: 1
}),
zIndex: 0
});
break;
default:
}
return style;
};
};
H_MVT.shizuokaRinhankai1 = new ol.layer.VectorTile(new ShizuokaRinhankai());
H_MVT.shizuokaRinhankai2 = new ol.layer.VectorTile(new ShizuokaRinhankai());
function ShizuokaRinhankai(){
this.folder = "child";
this.category = "tisitutikei";
this.icon = "";
this.title = "静岡県林班界(MVT)";
this.name = "shizuokarinhankai";
this.origin = "";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/shizuoka_rinhankai/{z}/{x}/{y}.mvt")
});
this.style = H_MVT.shizuokaRinhankaiStyleFunction();
}
//------------------------------------------------------------------------------------------------------------------
//世界メッシュ 光
H_MVT.sekaiLightStyleFunction = function() {
//MVTタイルは7〜14まで詳細 1から6は簡易
var d3Color = d3.interpolateLab("black","yellow");
return function(feature, resolution) {
var zoom = H_COMMON.zoomForResolution(resolution);
var prop = feature.getProperties();
var text = prop["light"];
if(zoom>7) {//うーんzoomが一つずれるけど、どこで間違えている??とりあえずこれで問題なく動く
var lightNum = Number(prop["light"]);
var light100 = lightNum / 255;
}else{
var light100 = Number(prop["rate"]) / 10;
}
var rgb = d3.rgb(d3Color(light100));
var rgba;
if(zoom>7) {
if (light100 === 1) {
rgba = "rgba(255,165,0,0.8)";
} else {
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0.8 )";
}
}else{
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0.8 )";
}
var styles = [];
var fillStyle =
new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
var strokeStyle =
new ol.style.Style({
stroke: new ol.style.Stroke({
color: "silver",
width: 1
})
});
var textStyle =
new ol.style.Style({
text: new ol.style.Text({
font: "14px sans-serif",
text: text,
placement:"point",
fill: new ol.style.Fill({
color: "black"
}),
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
exceedLength:true
})
});
styles.push(fillStyle);
if(zoom>=13) {
styles.push(strokeStyle);
styles.push(textStyle);
}
return styles;
};
};
function SekaiLight(){
this.folder = "child";
this.category = "sekaiMesh";
this.icon = "";
this.title = "NASA夜間光画像(MVT)世界メッシュ研究所";
this.name = "sekaiLight";
this.origin = "世界メッシュ研究所 NASA夜間光データプロダクト";
this.detail = "世界メッシュ研究所さんの世界メッシュコードを使用しています。世界メッシュコードの上位20を削除すると地域メッシュコードになります。
本3次世界メッシュ夜間光統計はNASAが提供する全球夜間光画像(2012年)を元に世界メッシュ研究所が作成したものです。夜間光データの源データはアメリカ航空宇宙局(NASA)に帰属します。データの品質や信頼性について世界メッシュ研究所、NASAが一切保証するものではなく、利用者が本データセットの利用によって生じた損害または損失について世界メッシュ研究所、NASAは一切の責任を負うものではありません。Data courtesy Marc Imhoff of NASA GSFC and Christopher Elvidge of NOAA NGDC. Image by Craig Mayhew and Robert Simmon, NASA GSFC. (c) NASA ";
this.source = new ol.source.VectorTile({
attributions:[new ol.Attribution({html:"世界メッシュ研究所 NASA夜間光データプロダクト"})],
format: new ol.format.MVT(),
maxZoom:14,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/sekai-light/{z}/{x}/{y}.mvt")
});
this.style = H_MVT.sekaiLightStyleFunction();
}
H_MVT.sekaiLight1 = new ol.layer.VectorTile(new SekaiLight());
H_MVT.sekaiLight2 = new ol.layer.VectorTile(new SekaiLight());
//------------------------------------------------------------------------------------------------------------------
//世界メッシュ 標高
H_MVT.sekaiAstStyleFunction = function() {
var d3Color = d3.interpolateLab("white","midnightblue");
return function(feature, resolution) {
var zoom = H_COMMON.zoomForResolution(resolution);
var prop = feature.getProperties();
var text = Math.floor(Number(prop["alt_mean"])*10)/10;
/*
if(zoom>7) {//うーんzoomが一つずれるけど、どこで間違えている??とりあえずこれで問題なく動く
var lightNum = Number(prop["light"]);
var light100 = lightNum / 255;
}else{
var light100 = Number(prop["rate"]) / 10;
}
*/
var alt100 = Number(prop["rate"]) / 11;
var rgb = d3.rgb(d3Color(alt100));
var rgba;
rgba = "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ", 0.9 )";
var styles = [];
var fillStyle =
new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
var strokeStyle =
new ol.style.Style({
stroke: new ol.style.Stroke({
color: "silver",
width: 1
})
});
var textStyle =
new ol.style.Style({
text: new ol.style.Text({
font: "10px sans-serif",
text: "平均" + String(text) + "m",
placement:"point",
fill: new ol.style.Fill({
color: "black"
}),
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
exceedLength:true
})
});
styles.push(fillStyle);
if(zoom>=10) {
styles.push(strokeStyle);
}
if(zoom>=14) {
styles.push(textStyle);
}
return styles;
};
};
function SekaiAst(){
this.folder = "child";
this.category = "sekaiMesh";
this.icon = "";
this.title = "標高1kメッシュ(MVT)世界メッシュ研究所";
this.name = "sekaiAst";
this.origin = "世界メッシュ研究所 ";
this.detail = "世界メッシュ研究所さんの世界メッシュコードを使用しています。世界メッシュコードの上位20を削除すると地域メッシュコードになります。
本3次世界メッシュ標高統計はASTER全球数値地表モデル(ASTER GDEM Ver. 3 beta版)を元に作成したものです。本データを利用し、インターネット上や学術雑誌・出版物において公表する場合は世界メッシュ標高統計が世界メッシュ研究所のものであること、および、ASTER GDEMの源データが経済産業省(METI)とアメリカ航空宇宙局(NASA)に帰属することについて必ず明記願います。データの品質や信頼性について世界メッシュ研究所、NASA、経済産業省(METI)及び宇宙システム開発利用推進機構が一切保証するものではなく、利用者が本データセットの利用によって生じた損害または損失について世界メッシュ研究所、NASA、経済産業省(METI)及び、宇宙システム開発利用推進機構は一切の責任を負うものではありません。(c)METI, (c) NASA ";
this.source = new ol.source.VectorTile({
attributions:[new ol.Attribution({html:"世界メッシュ研究所 ASTER GDEM データプロダクト"})],
format: new ol.format.MVT(),
maxZoom:14,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/aster/{z}/{x}/{y}.mvt")
});
this.style = H_MVT.sekaiAstStyleFunction();
}
H_MVT.sekaiAst1 = new ol.layer.VectorTile(new SekaiAst());
H_MVT.sekaiAst2 = new ol.layer.VectorTile(new SekaiAst());
//------------------------------------------------------------------------------------------------------------------
//全国医療機関
H_MVT.iryoukikanStyleFunction = function (kamoku) {
return function (feature, resolution) {
var prop = feature.getProperties();
var iryoukikanCode = prop["P04_001"];
if(iryoukikanCode==="3") return;
var kamokuAll = prop["P04_004"] + "/" + prop["P04_005"] + "/" + prop["P04_006"];
if(kamoku){
if(kamokuAll.indexOf(kamoku)===-1){
return;
}
}
var fillColor,radius;
var zoom = H_COMMON.zoomForResolution(resolution);
switch (iryoukikanCode) {
case "1":
fillColor = "blue";
radius = 8;
break;
case "2":
if(zoom<11) return;
fillColor = "teal";
radius = 4;
break;
default:
}
var styles = [];
var fill = new ol.style.Style({
image: new ol.style.Circle({
radius: radius,
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({
color: "white",
width: 1
})
})
});
var text = new ol.style.Style({
text: new ol.style.Text({
font: "8px sans-serif",
text: prop["P04_002"],
offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
overflow:true
})
});
styles.push(fill);
if(zoom>16) styles.push(text);
return styles;
}
};
function Iryoukikan() {
this.folder = "child";
this.category = "KosodateFukushi";
this.icon = "";
this.title = "全国医療機関(MVT)";
this.name = "iryoukikan";
this.origin = "国土数値情報 医療機関データ(H26年度)";
this.detail = "";
this.detail2 =
"" +
"科目:"+
"" +
" " +
"
";
this.style = H_MVT.iryoukikanStyleFunction();
//this.maxResolution = 152.87;
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/iryou-mvt/{z}/{x}/{y}.mvt")
});
}
H_MVT.iryoukikan_1 = new ol.layer.VectorTile(new Iryoukikan());
H_MVT.iryoukikan_2 = new ol.layer.VectorTile(new Iryoukikan());
//------------------------------------------------------------------------------------------------------------------
//通勤
H_MVT.tuukinStyleFunction = function (citycodes,citycodeP,nin,ninP,maxcolor,ninMax,ninMin) {
return function (feature, resolution) {
var prop = feature.getProperties();
var citycode0 = prop["N03_007"];
var color = "rgba(0,0,200,0.3)";
var text;
var index = citycodes.indexOf(citycode0);
//console.log(ninP,ninMax)
//var ritu = 1/Number(ninP);
var ritu = 1/Number(ninMax);
var d3Color = d3.interpolateLab("whitesmoke",maxcolor);
if(index!==-1){
if(nin[index]>5) {
var rate = nin[index] * ritu;
/*
var rate2;
if (rate > 0.5) {
rate2 = 0.8;
} else if (rate > 0.4) {
rate2 = 0.6;
} else if (rate > 0.3) {
rate2 = 0.5;
} else if (rate > 0.2) {
rate2 = 0.4;
} else if (rate > 0.1) {
rate2 = 0.3;
} else if (rate > 0.5) {
rate2 = 0.2;
} else {
rate2 = 0.05;
}
*/
//var d3rgb = d3.rgb(d3Color(rate2));
var d3rgb = d3.rgb(d3Color(rate));
//console.log(d3rgb);
color = "rgba(" + d3rgb.r + "," + d3rgb.g + "," + d3rgb.b + ", 0.8 )";
if(prop["N03_004"]) {
text = prop["N03_004"] + "\n" + nin[index] + "人"
}else{
text = prop["N03_003"] + "\n" + nin[index] + "人"
}
}
}
var width = 1;
if(citycodeP===citycode0){
color = "lime";
var width = 1;
}
var styles = [];
var fillStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: color
})
});
var strokeStyle = new ol.style.Style({
stroke: new ol.style.Stroke({
color: "black",
width: width
})
});
var textStyle = new ol.style.Style({
text: new ol.style.Text({
font: "14px sans-serif",
text: text,
//offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
overflow:true,
exceedLength:true,
placement:"point"
})
});
var zoom = H_COMMON.zoomForResolution(resolution);
if(zoom>7) {
styles.push(fillStyle);
styles.push(strokeStyle);
}else{
if(index!==-1){
if(nin[index]>5){
styles.push(fillStyle);
styles.push(strokeStyle);
}
}
}
if(zoom>9){
styles.push(textStyle);
}
return styles;
}
};
function Tuukin() {
this.folder = "child";
this.category = "ZinkouKeizai";
this.icon = "";
this.title = "どこへ通勤通学?(MVT)";
this.name = "tuukin";
this.origin = "e-stat 従業・通学市区町村,常住市区町村,男女別自宅外就業者数及び通学者数 - 全国,市区町村 6-1 自宅外就業者及び通学者総数";
this.detail = "自宅外就業者及び通学者総数です。5人以下は表示しないようにしています。";
this.detail2 =
"" +
"流出or流入:"+
"" +
"
";
this.style = H_MVT.tuukinStyleFunction(["dummy"]);
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:13,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/tuukin2/{z}/{x}/{y}.mvt")
});
}
H_MVT.tuukin_1 = new ol.layer.VectorTile(new Tuukin());
H_MVT.tuukin_2 = new ol.layer.VectorTile(new Tuukin());
//------------------------------------------------------------------------------------------------------------------
//事故
function Ziko(){
this.folder = "child";
this.category = "test";
this.icon = "";
this.title = "事故(MVT)test";
this.name = "ziko";
this.origin = "";
this.detail = "";
this.source = new ol.source.VectorTile({
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/ziko/{z}/{x}/{y}.mvt")
});
//this.maxResolution = 1222.99;
this.style = zikoStyleFunction;
}
function zikoStyleFunction(feature, resolution) {
var prop = feature.getProperties();
var fillColor = "red"
var style = new ol.style.Style({
image: new ol.style.Circle({
radius:8,
fill: new ol.style.Fill({
color: fillColor
}),
stroke: new ol.style.Stroke({color: "white", width: 1})
})
});
return style;
}
H_MVT.ziko1 = new ol.layer.VectorTile(new Ziko());
H_MVT.ziko2 = new ol.layer.VectorTile(new Ziko());
//did-----------------------------------------------------------------------------------------------------------
H_MVT.didmvtStyleFunction = function() {
return function (feature, resolution) {
var prop = feature.getProperties();
var zoom = H_COMMON.zoomForResolution(resolution);
var rgba = "rgba(255,0,0,0.5)";
var styles = [];
var text = String(prop["JINKO"]);
var fillStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: rgba
})
});
function strokeStyle1(width){
var strokeStyle0 = new ol.style.Style({
stroke: new ol.style.Stroke({
color: "black",
width: width
})
});
return strokeStyle0;
}
var textStyle = new ol.style.Style({
text: new ol.style.Text({
font: "10px sans-serif",
text: text,
//offsetY: 10,
stroke: new ol.style.Stroke({
color: "white",
width: 3
}),
overflow:true,
exceedLength:true,
placement:"point"
})
});
styles.push(fillStyle);
if(zoom>=15) {
styles.push(strokeStyle1(1.0));
}else if(zoom>=12) {
styles.push(strokeStyle1(0.25));
}else if(zoom>=11) {
styles.push(strokeStyle1(0.1));
}
if(zoom>=11) styles.push(textStyle);
return styles;
}
};
function DidMvt(){
this.folder="child";
this.category="ZinkouKeizai";
this.title="人口集中地区(DID地区)(MVT)";
this.name="didmvt";
this.origin="総務省統計局";
this.detail="";
this.icon = "";
this.source=new ol.source.VectorTile({
overlaps:false,
transition:0,
format: new ol.format.MVT(),
maxZoom:15,
url: H_CONFIG.pFunc("https://kenzkenz.github.io/did/{z}/{x}/{y}.mvt")
});
// var arguments = {
// "target":{"val":"normal"},
// "column":{"val":"MAX_SIN"}
// };
this.style=H_MVT.didmvtStyleFunction();
this.myStyleFunction = H_MVT.didmvtStyleFunction;
}
H_MVT.didmvt_1 = new ol.layer.VectorTile(new DidMvt());
H_MVT.didmvt_2 = new ol.layer.VectorTile(new DidMvt());
}());