{"version":3,"sources":["webpack:///./src/projectModules/water-leakage-demo/vtile-options.js"],"names":["TYPE_KEY_METER","ICONS_METER","name","url","size","TYPE_KEY_BENSEN","ICONS_KYUSUIKAN_BENSEN","TYPE_KEY_HAISUIKAN","COLORS_HAISUIKAN","color","getIcon","properties","iconList","typeKey","category","iconObj","find","icon","iconUrl","iconSize","L","getColor","colorList","colorObj","vectorTileLayerStyles","meter","style","bensen","haisuikan","zoomLevel","weigtht","weight","fill","vectorTileLayerEvent","eventType","event"],"mappings":"+SAOMA,EAAiB,sBACjBC,EAAc,CAClB,CACEC,KAAM,cACNC,IAAK,gDACLC,KAAM,CAAC,GAAI,MAOTC,EAAkB,SAClBC,EAAyB,CAC7B,CACEJ,KAAM,WACNC,IAAK,kDACLC,KAAM,CAAC,GAAI,KAEb,CACEF,KAAM,WACNC,IAAK,kDACLC,KAAM,CAAC,GAAI,MAOTG,EAAqB,sBACrBC,EAAmB,CAAC,CAAEN,KAAM,aAAcO,MAAO,YAuBvD,SAASC,EAAQC,EAAYC,EAAUC,GAErC,IAAMC,EAAWH,EAAWE,GACtBE,EAAUH,EAASI,MAAK,SAACC,GAAI,OAAKA,EAAKf,OAASY,KAChDI,EACJH,GAAWA,EAAQZ,IACfY,EAAQZ,IACR,2CACAgB,EAAWJ,GAAWA,EAAQX,KAAOW,EAAQX,KAAO,CAAC,GAAI,IACzDa,EAAOG,IAAEH,KAAK,CAClBC,UACAC,aAEF,OAAOF,EAGT,SAASI,EAASV,EAAYW,EAAWT,GAEvC,IAAMC,EAAWH,EAAWE,GACtBU,EAAWD,EAAUN,MAAK,SAACP,GAAK,OAAKA,EAAMP,OAASY,KACpDL,EAAQc,GAAYA,EAASd,MAAQc,EAASd,MAAQ,UAC5D,OAAOA,EAGF,IAAMe,EAAwB,CAKnCC,MAAK,SAACd,GACJ,IAAMM,EAAOP,EAAQC,EAAYV,EAAaD,GACxC0B,EAAQ,CACZT,QAEF,OAAOS,GAGTC,OAAM,SAAChB,GACL,IAAMM,EAAOP,EAAQC,EAAYL,EAAwBD,GACnDqB,EAAQ,CACZT,QAEF,OAAOS,GAGTE,UAAS,SAACjB,EAAYkB,GAEpB,IAAMC,EAAUD,EAAY,GAAK,GAAMA,EAAY,GAAK,EAAM,EACxDpB,EAAQY,EAASV,EAAYH,EAAkBD,GAC/CmB,EAAQ,CACZK,OAAQD,EACRrB,MAAOA,EACPuB,MAAM,GAER,OAAON,IAIJ,SAASO,EAAqBC,EAAWC","file":"chunk-2d0cbec3.56704606ec8b39b8a9be.js","sourcesContent":["import L from \"leaflet\";\n\n/*\n * TYPE_KEY_xxxで、propertiesのキーを指定。\n * ICONS_xxxで、それぞれのキーのときの各アイコンのURLとサイズを指定。\n * メーターはproperties[\"infrastructure_type\"]でアイコン切り替え(1種類)\n */\nconst TYPE_KEY_METER = \"infrastructure_type\";\nconst ICONS_METER = [\n {\n name: \"Water Meter\",\n url: \"img/map-symbols/waterleakage/meter-normal.svg\",\n size: [20, 20],\n },\n];\n\n/*\n * 弁栓はproperties[\"status\"]でアイコン切り替え。(2種類)\n */\nconst TYPE_KEY_BENSEN = \"status\";\nconst ICONS_KYUSUIKAN_BENSEN = [\n {\n name: \"Existing\",\n url: \"img/map-symbols/waterleakage/bensen-shikiri.svg\",\n size: [20, 20],\n },\n {\n name: \"Inactive\",\n url: \"img/map-symbols/waterleakage/bensen-shikiri.svg\",\n size: [16, 16],\n },\n];\n\n/*\n * 配水管はproperties[\"infrastructure_type\"]で色を切り替え。(1種類)\n */\nconst TYPE_KEY_HAISUIKAN = \"infrastructure_type\";\nconst COLORS_HAISUIKAN = [{ name: \"Water Pipe\", color: \"#0000ff\" }];\n/**\n * 以下、properties[\"materia\"]で色分けをする場合(15種類)\n const TYPE_KEY_HAISUIKAN = \"material\";\n const COLORS_HAISUIKAN = [\n { name: \"Steel\", color: \"#0000ff\" },\n { name: \"Unknown\", color: \"#0000ff\" },\n { name: \"Polyvinyl Chloride\", color: \"#0000ff\" },\n { name: \"Medium Density Polye\", color: \"#0000ff\" },\n { name: \"Polyethylene\", color: \"#0000ff\" },\n { name: \"Cast Iron\", color: \"#0000ff\" },\n { name: \"Reinforced Concrete\", color: \"#0000ff\" },\n { name: \"Copper\", color: \"#0000ff\" },\n { name: \"Galvanised Wrought I\", color: \"#0000ff\" },\n { name: \"Victaulic\", color: \"#0000ff\" },\n { name: \"Galvanised Steel\", color: \"#0000ff\" },\n { name: \"High Density Polyeth\", color: \"#0000ff\" },\n { name: \"Ductile Iron\", color: \"#0000ff\" },\n { name: \"Pvc Modified\", color: \"#0000ff\" },\n { name: \"Asbestos Cement\", color: \"#0000ff\" },\n ];\n */\n\nfunction getIcon(properties, iconList, typeKey) {\n /** リストからurlとsizeを取得。デフォルトは、画像はunknown.svg、サイズは[20,20] */\n const category = properties[typeKey];\n const iconObj = iconList.find((icon) => icon.name === category);\n const iconUrl =\n iconObj && iconObj.url\n ? iconObj.url\n : \"img/map-symbols/waterleakage/unknown.svg\";\n const iconSize = iconObj && iconObj.size ? iconObj.size : [20, 20];\n const icon = L.icon({\n iconUrl,\n iconSize,\n });\n return icon;\n}\n\nfunction getColor(properties, colorList, typeKey) {\n /** リストから色コードを取得。デフォルトは、#888888 */\n const category = properties[typeKey];\n const colorObj = colorList.find((color) => color.name === category);\n const color = colorObj && colorObj.color ? colorObj.color : \"#888888\";\n return color;\n}\n\nexport const vectorTileLayerStyles = {\n /**\n * \"aaa(properties){..}\" aaaの部分は、TippecanoeでGeoJSONをベクタータイルを作成するときに指定するレイヤー名。\n * ref: https://leaflet.github.io/Leaflet.VectorGrid/vectorgrid-api-docs.html\n */\n meter(properties) {\n const icon = getIcon(properties, ICONS_METER, TYPE_KEY_METER);\n const style = {\n icon,\n };\n return style;\n },\n\n bensen(properties) {\n const icon = getIcon(properties, ICONS_KYUSUIKAN_BENSEN, TYPE_KEY_BENSEN);\n const style = {\n icon,\n };\n return style;\n },\n\n haisuikan(properties, zoomLevel) {\n /** zoomLevelによって、線のweightを変える */\n const weigtht = zoomLevel < 15 ? 0.5 : zoomLevel < 17 ? 1.0 : 2.0;\n const color = getColor(properties, COLORS_HAISUIKAN, TYPE_KEY_HAISUIKAN);\n const style = {\n weight: weigtht,\n color: color,\n fill: false,\n };\n return style;\n },\n};\n\nexport function vectorTileLayerEvent(eventType, event) {}\n"],"sourceRoot":""}