Skip to content

Commit

Permalink
Add Detailed maps for Ancient Tree Stump and Royal Hidden Passage
Browse files Browse the repository at this point in the history
  • Loading branch information
savage13 committed Feb 10, 2024
1 parent d721b21 commit f013b0c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/game_files/ecosystem/cave_polys_detail.json

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions src/components/AppMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,15 @@ export default class AppMap extends mixins(MixinUtil) {
featureCollectionToPolygons(areas: any) {
return Object.fromEntries(areas.features.map((feat: any) => {
if (feat.properties.Area !== undefined) {
feat.geometry.properties = { title: feat.properties.Area.toString() }
feat.geometry.properties = {
title: feat.properties.Area.toString(),
color: feat.properties.color || undefined
}
} else if (feat.properties.group != undefined) {
feat.geometry.properties = { title: feat.properties.group }
feat.geometry.properties = {
title: feat.properties.group,
color: feat.properties.color || undefined
}
return [feat.properties.group, [feat.geometry]];
}
return [feat.properties.Area, [feat.geometry]]
Expand Down Expand Up @@ -1672,7 +1678,8 @@ export default class AppMap extends mixins(MixinUtil) {
const layers: L.GeoJSON[] = features.map((feature: any) => {
return L.geoJSON(feature, {
style: function(_) {
return { weight: 2, fillOpacity: 0.2, color: ui.genColor(entries.length, i) };
let color = feature.properties.color || ui.genColor(entries.length, i);
return { weight: 2, fillOpacity: 0.2, color }
},
// @ts-ignore
contextmenu: true,
Expand All @@ -1694,6 +1701,11 @@ export default class AppMap extends mixins(MixinUtil) {
layer.bindTooltip(features[0].properties.title);
continue;
}
if (name == "cave_polys_detail") {
let title = features[0].properties.title.split("::").at(0)
layer.bindTooltip(title);
continue;
}
const area = await MsgMgr.getInstance().getAreaData(name, parseInt(data));
const climate = await MsgMgr.getInstance().getClimateData(area.Climate);
const area_name = MsgMgr.getInstance().getMsgWithFile("StaticMsg/LocationMarker", area.Name);
Expand Down
1 change: 1 addition & 0 deletions src/components/AppMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<b-radio value="Sky">Sky Field Map Areas</b-radio>
<b-radio value="sky_polys">Sky Regions <div style="display: inline; font-size:0.8em">(approximate)</div></b-radio>
<b-radio value="cave_polys">Cave Regions <div style="display: inline; font-size:0.8em">(approximate)</div></b-radio>
<b-radio value="cave_polys_detail">Cave Regions <div style="display: inline; font-size:0.8em">(detailed)</div></b-radio>

<!-- <b-radio value="LoadBalancer">Load balancer areas</b-radio> -->
</b-radio-group>
Expand Down

0 comments on commit f013b0c

Please sign in to comment.