Skip to content

Commit

Permalink
wip: Improve map styling #816
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Feb 6, 2024
1 parent a8945d6 commit 1dcf3c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions map/client/leaflet/utils/utils.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ export function convertToLeafletFromSimpleStyleSpec (style, inPlace) {
return convertedStyle
}

export function getDefaultMarker (feature, latlng, options) {
export function getDefaultMarker (feature, latlng, options, engine) {
const properties = feature.properties
const leafletOptions = options.leaflet || options
const style = Object.assign({},
_.get(this, 'activityOptions.engine.pointStyle'),
_.get(engine, 'pointStyle'),
leafletOptions.layerStyle,
convertToLeafletFromSimpleStyleSpec(feature.style || feature.properties))
// We allow to template style properties according to feature,
Expand All @@ -138,11 +138,11 @@ export function getDefaultMarker (feature, latlng, options) {
return (latlng ? createLeafletMarkerFromStyle(latlng, style) : style)
}

export function getDefaultStyle (feature, options) {
export function getDefaultStyle (feature, options, engine) {
const properties = feature.properties
const leafletOptions = options.leaflet || options
const style = Object.assign({},
_.get(this, 'activityOptions.engine.featureStyle'),
_.get(engine, 'featureStyle'),
leafletOptions.layerStyle,
convertToLeafletFromSimpleStyleSpec(feature.style || feature.properties))

Expand Down
4 changes: 2 additions & 2 deletions map/client/mixins/map/mixin.geojson-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ export const geojsonLayers = {
bindLeafletEvents(layer, LeafletEvents.Feature, this, options)
},
style: (feature) => {
return this.generateStyle('featureStyle', feature, options)
return this.generateStyle('featureStyle', feature, options, _.get(this, 'activityOptions.engine'))
},
pointToLayer: (feature, latlng) => {
return this.generateStyle('markerStyle', feature, latlng, options)
return this.generateStyle('markerStyle', feature, latlng, options, _.get(this, 'activityOptions.engine'))
}
}

Expand Down

0 comments on commit 1dcf3c5

Please sign in to comment.