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

paintRules - all road LineSymbolizer color properties are set to "major" theme value instead of appropriate theme value #146

Open
Dixter opened this issue Mar 18, 2024 · 1 comment

Comments

@Dixter
Copy link

Dixter commented Mar 18, 2024

This prevents styling of different roads kinds by modifying theme values.

The color properties on lines 302, 318, 333 & 367 of src/default_style/style.ts, should be updated to t.other, t.minor_a, t.medium & t.highway respectively

{
	dataLayer: "roads",
	symbolizer: new LineSymbolizer({
		color: t.other,
		width: (z, f) => {
			return exp(1.6, [
				[14, 0],
				[20, 7],
			])(z);
		},
	}),
	filter: (z, f) => {
		const kind = getString(f.props, "pmap:kind");
		return ["other", "path"].includes(kind);
	},
},
{
	dataLayer: "roads",
	symbolizer: new LineSymbolizer({
		color: t.minor_a,
		width: (z, f) => {
			return exp(1.6, [
				[13, 0],
				[18, 8],
			])(z);
		},
	}),
	filter: (z, f) => {
		return f.props["pmap:kind"] === "minor_road";
	},
},
{
	dataLayer: "roads",
	symbolizer: new LineSymbolizer({
		color: t.medium,
		width: (z, f) => {
			return exp(1.6, [
				[7, 0],
				[12, 1.2],
				[15, 3],
				[18, 13],
			])(z);
		},
	}),
	filter: (z, f) => {
		return f.props["pmap:kind"] === "medium_road";
	},
},
{
	dataLayer: "roads",
	symbolizer: new LineSymbolizer({
		color: t.major,
		width: (z, f) => {
			return exp(1.6, [
				[6, 0],
				[12, 1.6],
				[15, 3],
				[18, 13],
			])(z);
		},
	}),
	filter: (z, f) => {
		return f.props["pmap:kind"] === "major_road";
	},
},
{
	dataLayer: "roads",
	symbolizer: new LineSymbolizer({
		color: t.highway,
		width: (z, f) => {
			return exp(1.6, [
				[3, 0],
				[6, 1.1],
				[12, 1.6],
				[15, 5],
				[18, 15],
			])(z);
		},
	}),
	filter: (z, f) => {
		return f.props["pmap:kind"] === "highway";
	},
},
@bdon
Copy link
Member

bdon commented Mar 18, 2024

Thanks, I have not had the time to implement this yet. If you need custom styling of specific tags I’d recommend using maplibre instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants