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

feature: add configurable highlight to measure line for visibility #2034

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

Grammostola
Copy link
Contributor

Seeks to fix #2023

It introduces a highlight to the measure line in order to increase its visibility on various backgrounds, by default a light blue highlight (it was an idea pitched in a meeting some time ago and it is a shorter route than adapting measure to employ the stylewindow that draw uses)

Configurable via a new prop for the measure control:

    {
      "name": "measure",
      "options": {
        "hideWhenEmbedded": true,
        "showSegmentLengths": true,
        "highlightColor": "rgba(230, 126, 34, 0.7)"
      }
    },

image

@asemoller
Copy link
Contributor

Nice @Grammostola!
Works as expected!

@Grammostola
Copy link
Contributor Author

Cool!

If no one has any objections I shall then merge this shortly and arrange the necessary documentation.

@johnnyblasta
Copy link
Collaborator

I'm getting a error when using the buffer meaure tool:

TypeError: style.getImage is not a function
    at renderFeature (vector.js:122:28)
    at CanvasVectorLayerRenderer.renderFeature (VectorLayer.js:773:68)
    at render (VectorLayer.js:695:30)
    at CanvasVectorLayerRenderer.prepareFrame (VectorLayer.js:715:7)
    at VectorLayer.render (Layer.js:383:23)
    at CompositeMapRenderer.renderFrame (Composite.js:145:29)
    at Map.renderFrame_ (Map.js:1598:20)
    at Map.animationDelay_ (Map.js:1452:10)

@Grammostola
Copy link
Contributor Author

Thanks for your report! Please try now.

Copy link
Collaborator

@johnnyblasta johnnyblasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Grammostola Grammostola merged commit 60bb6e2 into master Aug 21, 2024
4 checks passed
@Grammostola Grammostola deleted the measure-style branch August 21, 2024 08:43
asemoller pushed a commit to SigtunaGIS/origo that referenced this pull request Aug 25, 2024
…rigo-map#2034)

* feature: add configurable highlight to measure line for visibility

* fix: make buffer tool work
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

Successfully merging this pull request may close these issues.

Measure - set style in json
3 participants