question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pointerMove select style is not rendered / Selected Objects type LineString

See original GitHub issue

Describe the bug

  1. Select style is not rendered immediately - only after zoom event is triggered [style given via style attribute of Select() with condition pointerMove]

  2. When binding to ‘select’ of the pointerMove-Select() the given objects in e.selected are of type “LineString” and therefor not styleable via setStyle() [“.setStyle() is not a function”]

To Reproduce

  1. When zooming with the cursor above a selectable line the select-style is rendered but without zooming it isnt.

  2. Console out getType() of the objects inside of e.selected => “LineString”

Expected behavior

  1. Immediate render of select-Style on pointerMove/Hover

  2. Expected the objects in e.selected to be features to call setStyle()

System

  • Angular 8.0.3
  • ol 5.3.3

Screencast

pointerMove

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ahocevarcommented, Jul 23, 2019

You cannot setStyle() on a RenderFeature, which is the default feature class for ol/source/MVT. If you want to go that route, you need to configure your source like this

import MVT from 'ol/format/MVT';
import Feature from 'ol/Feature';

new MVT({
  featureClass: Feature
});
0reactions
DwieDavecommented, Jul 23, 2019

Thanks! That solved the problem; So not an Issue! (closed)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pointermove select event works but not the click select in ...
I am drawing linestring and point feature types on separate vector layers. ... The example shows different types of Select interaction.
Read more >
OpenLayers v7.2.2 API - Module: ol/interaction/Select
A function that takes an Feature and returns true if the feature may be selected or false otherwise. Options{Object}. Properties: Name, Type ......
Read more >
Selecting only specific features not all, and dragging and ...
Yes it works fine, but I would like to select features based on pointermove not click, in that example I need first select...
Read more >
Editing Massive Geospatial Data Sets with nebula.gl | Uber Blog
For users who need geospatial drawing on a map but not deck.gl's massive data rendering technologies, this is a great option. Check this ......
Read more >
VS Code API | Visual Studio Code Extension API
However, when invoking an editor command not all argument types are supported. ... Namespace for participating in language-specific editor features, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found