Skip to content

Commit

Permalink
fix props update code for avoiding lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
halsk committed Jan 2, 2024
1 parent 9be4384 commit 92d7441
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions components/PrintableMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ export default {
center() {
return this.mapConfig.center;
},
setLayerSettings(name, color, bg_color, icon_class) {
const newConfig = this.mapConfig;
newConfig.layer_settings[name] = {
color,
bg_color
};
if (icon_class) {
newConfig.layer_settings[name].icon_class = icon_class;
}
this.$emit("update:mapConfig", newConfig);
return newConfig;
},
inBoundsMarkers() {
const inBoundsMarkers = [];
this.layers.map((layer) => {
Expand Down Expand Up @@ -261,11 +275,11 @@ export default {
bg_color += ((parseInt(crc16(category.substr(0)), 16) % 32) + 128).toString(16);
bg_color += ((parseInt(crc16(category.substr(1)), 16) % 32) + 128).toString(16);
bg_color += ((parseInt(crc16(category.substr(2)), 16) % 32) + 128).toString(16);
self.mapConfig.layer_settings[category] = {
this.$emit('setLayerSettings', {
name: category,
color,
bg_color,
};
})
}
});
self.layers.push({
Expand Down

0 comments on commit 92d7441

Please sign in to comment.