Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/ui/locations/entries/pin default_icon without a location.record property #1598

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions lib/ui/locations/entries/pin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ export default function pin(entry) {
return;
}

const default_icon = {
type: 'markerLetter',
letter: entry.location.record.symbol,
color: entry.location.record.colour,
scale: entry.style?.scale || 3,
anchor: [0.5, 1]
}

// Assign srid from location.layer if not implicit.
entry.srid ??= entry.location.layer.srid

Expand All @@ -83,11 +75,7 @@ export default function pin(entry) {

entry.zIndex ??= Infinity

if (entry.style) {
entry.style.icon = default_icon
}

entry.Style ??= entry.style ? mapp.utils.style(entry.style) : entry.location.pinStyle
entry.Style ??= entry.style ? mapp.utils.style(entry.style): entry.location.pinStyle

entry.srid ??= entry.location.layer.srid

Expand Down
6 changes: 0 additions & 6 deletions lib/ui/locations/listview.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ export default function listview(params) {
fillOpacity: 0.1
};

//Spread assign to the default `markerLetter` pin if only one property is provided
locale.locations.pinStyle = {...{ type: 'markerLetter',scale: 3, anchor: [0.5, 1] }, ...locale.locations.pinStyle}

//Assign default records or `listview_records` to the location
locale.locations.records ??= locale.listview_records || structuredClone(records)

Expand Down Expand Up @@ -211,7 +208,6 @@ export default function listview(params) {
Triggers the event to add the location to view.
Prepends new locations to the listview, minimizing the other locations when a new one is selected


@param {location} location
*/
function setRecord(target, key, location) {
Expand Down Expand Up @@ -275,7 +271,6 @@ export default function listview(params) {

return !!location
}

}

/**
Expand All @@ -288,7 +283,6 @@ Controls whether the clear all button is shown by checking if any locations are

@param {locale} locale
*/

function gazCheck(locale) {

// clearAll should not be shown without locations to clear
Expand Down
Loading