{"version":3,"sources":["webpack:///./src/projectModules/geoJsonOptions/forest-geoJsonOptions.js"],"names":["pointToLayer","feature","latlng","height","properties","colScale","chroma","scale","domain","fill","L","circleMarker","radius","fillColor","color","weight","opacity","fillOpacity","pointToLayer2","drawRectangle","canopyRdYlBu","slopeRdYlBu","filterCanopyHeight","url","URL","window","location","href","params","searchParams","min","get","max","size","arguments","length","undefined","circle","addTo","store","state","map","bounds","getBounds","removeFrom","rectangle","canopyHeightEvent","layer","on","fp","info","key","value","commit","canopyHeightEvent2","getValueEvent","geoJsonOptions","onEachFeature","canopy","filter","slope","contour","style","road","area","fillCol","opacityActive","sugi","hinoki","others","nodata","push"],"mappings":"+RAIMA,EAAe,SAACC,EAASC,GAC7B,IAAMC,EAASF,EAAQG,WAAW,iBAC5BC,EAAWC,IACdC,MAAM,CAAC,OAAQ,QAAS,SAAU,QAClCC,OAAO,CAAC,EAAG,KACRC,EAAOJ,EAASF,GAEtB,OAAOO,IAAEC,aAAaT,EAAQ,CAE5BU,OAAQ,EACRC,UAAWJ,EACXK,MAAO,UACPC,OAAQ,EACRC,QAAS,EACTC,YAAa,OAGXC,EAAgB,SAACjB,EAASC,GAC9B,IAAMC,EAASF,EAAQG,WAAW,OAC5BC,EAAWC,IACdC,MAAM,CAAC,OAAQ,QAAS,SAAU,QAClCC,OAAO,CAAC,EAAG,KACRC,EAAOJ,EAASF,GAChBW,EAAQ,UAEd,OAAOK,EAAcjB,EAAQ,EAAGO,EAAM,GAAKK,EAAO,EAAK,IAGnDM,EAAe,SAACnB,EAASC,GAC7B,IAAMC,EAASF,EAAQG,WAAW,OAC5BC,EAAWC,IAAOC,MAAM,UAAUC,OAAO,CAAC,GAAI,IAC9CC,EAAOJ,EAASF,GAChBW,EAAQ,UAEd,OAAOK,EAAcjB,EAAQ,EAAGO,EAAM,GAAKK,EAAO,EAAK,IAGnDO,EAAc,SAACpB,EAASC,GAC5B,IAAMC,EAASF,EAAQG,WAAW,SAC5BC,EAAWC,IAAOC,MA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CA,EAAMC,GAAG,aAAa,WACpB,IAAMC,EAAKhD,EAAQG,WACb8C,EAAO,CACX,CACEC,IAAK,wBACLC,MAAOH,EAAG,2BAGdV,OAAMc,OAAO,sBAAsB,GACnCd,OAAMc,OAAO,mBAAoB,CAAEH,KAAMA,OAE3CH,EAAMC,GAAG,YAAY,WACnBT,OAAMc,OAAO,sBAAsB,SAM5BG","file":"chunk-2d0b34dc.56704606ec8b39b8a9be.js","sourcesContent":["import store from \"@/store/index.js\";\nimport L from \"leaflet\";\nimport chroma from \"chroma-js\";\n\nconst pointToLayer = (feature, latlng) => {\n const height = feature.properties[\"Canopy Height\"];\n const colScale = chroma\n .scale([\"blue\", \"green\", \"yellow\", \"red\"])\n .domain([0, 40]);\n const fill = colScale(height);\n\n return L.circleMarker(latlng, {\n //renderer: store.state.canvasRenderer,\n radius: 5,\n fillColor: fill,\n color: \"#A08B50\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.95,\n });\n};\nconst pointToLayer2 = (feature, latlng) => {\n const height = feature.properties[\"val\"];\n const colScale = chroma\n .scale([\"blue\", \"green\", \"yellow\", \"red\"])\n .domain([0, 31]);\n const fill = colScale(height);\n const color = \"#A08B50\";\n // return drawCircle(latlng, 8, fill, 0.95, color, 1.0, 0);\n return drawRectangle(latlng, 8, fill, 0.9, color, 1.0, 0);\n};\n\nconst canopyRdYlBu = (feature, latlng) => {\n const height = feature.properties[\"val\"];\n const colScale = chroma.scale(\"RdYlBu\").domain([31, 0]);\n const fill = colScale(height);\n const color = \"#A08B50\";\n // return drawCircle(latlng, 8, fill, 0.95, color, 1.0, 0);\n return drawRectangle(latlng, 8, fill, 0.9, color, 1.0, 0);\n};\n\nconst slopeRdYlBu = (feature, latlng) => {\n const height = feature.properties[\"value\"];\n const colScale = chroma.scale(\"RdYlBu\").domain([70, 0]);\n const fill = colScale(height);\n const color = \"#A08B50\";\n // return drawCircle(latlng, 8, fill, 0.95, color, 1.0, 0);\n return drawRectangle(latlng, 2, fill, 0.9, color, 1.0, 0);\n};\n\nconst filterCanopyHeight = (feature, latlng) => {\n const url = new URL(window.location.href);\n const params = url.searchParams;\n const min = params.get(\"min\") ? params.get(\"min\") : 0;\n const max = params.get(\"max\") ? params.get(\"max\") : 9999;\n return feature.properties[\"val\"] >= min && feature.properties[\"val\"] <= max;\n};\n\nconst drawCircle = (\n latlng,\n size,\n fillColor = \"\",\n fillOpacity = 0.0,\n color = \"\",\n opacity = 0.0,\n weight = 0,\n) => {\n return L.circle(latlng, size, {\n fillColor: fillColor,\n fillOpacity: fillOpacity,\n color: color,\n weight: weight,\n opacity: opacity,\n });\n};\nconst drawCircleMarker = (\n latlng,\n size,\n fillColor = \"\",\n fillOpacity = 0.0,\n color = \"\",\n opacity = 0.0,\n weight = 0,\n) => {\n return L.circleMarker(latlng, {\n radius: size,\n fillColor: fillColor,\n fillOpacity: fillOpacity,\n color: color,\n weight: weight,\n opacity: opacity,\n });\n};\nconst drawRectangle = (\n latlng,\n size,\n fillColor = \"\",\n fillOpacity = 0.0,\n color = \"\",\n opacity = 0.0,\n weight = 0,\n) => {\n const circle = new L.circle(latlng, size);\n circle.addTo(store.state.map);\n const bounds = circle.getBounds();\n circle.removeFrom(store.state.map);\n return L.rectangle(bounds, {\n fillColor: fillColor,\n fillOpacity: fillOpacity,\n color: color,\n weight: weight,\n opacity: opacity,\n });\n};\n\nconst canopyHeightEvent = (feature, layer) => {\n layer.on(\"mouseover\", function () {\n const fp = feature.properties;\n const info = [\n {\n key: \"Canopy Height\",\n value: fp[\"Canopy Height\"],\n },\n ];\n store.commit(\"setInfoPanelIsShow\", true);\n store.commit(\"setInfoPanelInfo\", { info: info });\n });\n layer.on(\"mouseout\", function () {\n store.commit(\"setInfoPanelIsShow\", false);\n });\n};\nconst canopyHeightEvent2 = (feature, layer) => {\n layer.on(\"mouseover\", function () {\n const fp = feature.properties;\n const info = [\n {\n key: \"Canopy Height\",\n value: fp[\"val\"],\n },\n ];\n store.commit(\"setInfoPanelIsShow\", true);\n store.commit(\"setInfoPanelInfo\", { info: info });\n });\n layer.on(\"mouseout\", function () {\n store.commit(\"setInfoPanelIsShow\", false);\n });\n};\n\nconst getValueEvent = (feature, layer) => {\n layer.on(\"mouseover\", function () {\n const fp = feature.properties;\n const info = [\n {\n key: \"Value\",\n value: fp[\"value\"],\n },\n ];\n store.commit(\"setInfoPanelIsShow\", true);\n store.commit(\"setInfoPanelInfo\", { info: info });\n });\n layer.on(\"mouseout\", function () {\n store.commit(\"setInfoPanelIsShow\", false);\n });\n};\n\nconst geoJsonOptions = {\n \"hamamatsu-L4\": {\n pointToLayer: pointToLayer,\n onEachFeature: canopyHeightEvent,\n },\n canopy: {\n pointToLayer: pointToLayer2,\n onEachFeature: canopyHeightEvent2,\n },\n \"canopy-grid\": {\n pointToLayer: canopyRdYlBu,\n onEachFeature: canopyHeightEvent2,\n },\n \"canopy-filter\": {\n filter: filterCanopyHeight,\n pointToLayer: canopyRdYlBu,\n onEachFeature: canopyHeightEvent2,\n },\n slope: {\n pointToLayer: slopeRdYlBu,\n onEachFeature: getValueEvent,\n },\n contour: {\n style: (feature) => {\n return {\n color: \"#cd853f\",\n weight: 1.0,\n opacity: 1.0,\n };\n },\n },\n road: {\n style: (feature) => {\n return {\n color: \"#ffdc00\",\n weight: 5,\n opacity: 0.7,\n };\n },\n },\n area: {\n style: (feature) => {\n return {\n fill: false,\n // color: \"#ee6666\",\n color: \"#f00\",\n weight: 5,\n };\n },\n },\n \"tree-species\": {\n style: (feature) => {\n const fp = feature.properties;\n let fillCol = \"#fff\";\n let opacity = 0.0;\n let opacityActive = 0.6;\n const sugi = \"#fff\";\n const hinoki = \"#000\";\n // const sugi = \"#cdc733\";\n // const hinoki = \"#966c3b\";\n const others = \"#ffe6ca\";\n const nodata = \"rgba(0,0,0,0)\";\n if (fp[\"樹種1\"] == \"スギ\") {\n fillCol = sugi;\n opacity = opacityActive;\n } else if (fp[\"樹種1\"] == \"ヒノキ\") {\n fillCol = hinoki;\n opacity = opacityActive;\n } else if (fp[\"樹種1\"] == \"アカマツ\") {\n fillCol = others;\n opacity = opacityActive;\n } else if (fp[\"樹種1\"] == \"クロマツ\") {\n fillCol = others;\n opacity = opacityActive;\n } else if (fp[\"樹種1\"] == \"-\" || fp[\"樹種1\"] == null) {\n fillCol = nodata;\n opacity = 0.3;\n }\n return {\n fillColor: fillCol,\n fillOpacity: opacity,\n weight: 0,\n opacity: opacity,\n };\n },\n\n onEachFeature: function (feature, layer) {\n layer.on(\"mouseover\", function () {\n const fp = feature.properties;\n let info = [];\n if (fp[\"樹種1\"] != null && fp[\"樹種1\"] != \"-\") {\n info.push({ key: \"樹種1\", value: fp[\"樹種1\"] });\n store.commit(\"setInfoPanelIsShow\", true);\n }\n if (fp[\"樹種2\"] != null && fp[\"樹種2\"] != \"-\") {\n if (fp[\"樹種1\"] != fp[\"樹種2\"]) {\n info.push({ key: \"樹種2\", value: fp[\"樹種2\"] });\n }\n }\n if (fp[\"樹種3\"] != null && fp[\"樹種3\"] != \"-\") {\n if (fp[\"樹種2\"] != fp[\"樹種3\"]) {\n info.push({ key: \"樹種3\", value: fp[\"樹種3\"] });\n }\n }\n store.commit(\"setInfoPanelInfo\", { info: info });\n });\n layer.on(\"mouseout\", function () {\n store.commit(\"setInfoPanelIsShow\", false);\n });\n },\n },\n\n \"hamamatsu-L2\": {\n pointToLayer: function (feature, latlng) {\n const height = feature.properties[\"Canopy Height (rh100)\"];\n const colScale = chroma\n .scale([\"blue\", \"green\", \"yellow\", \"red\"])\n .domain([0, 40]);\n const fill = colScale(height);\n\n return L.circleMarker(latlng, {\n //renderer: store.state.canvasRenderer,\n radius: 5,\n fillColor: fill,\n color: \"#A08B50\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.95,\n });\n },\n\n onEachFeature: function (feature, layer) {\n layer.on(\"mouseover\", function () {\n const fp = feature.properties;\n const info = [\n {\n key: \"Canopy Height (rh100)\",\n value: fp[\"Canopy Height (rh100)\"],\n },\n ];\n store.commit(\"setInfoPanelIsShow\", true);\n store.commit(\"setInfoPanelInfo\", { info: info });\n });\n layer.on(\"mouseout\", function () {\n store.commit(\"setInfoPanelIsShow\", false);\n });\n },\n },\n};\n\nexport default geoJsonOptions;\n"],"sourceRoot":""}