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

hit-tolerance property in vl-interaction-select is not working as intended #250

Closed
dreamw4lker opened this issue Nov 5, 2019 · 2 comments · Fixed by CodeForBaltimore/codeforbaltimore.org#20
Assignees
Labels

Comments

@dreamw4lker
Copy link

In my case I want to use this property to select a feature within some pixels, similar to behavior in this Openlayers guide: https://openlayers.org/en/latest/examples/hit-tolerance.html.

But I found out that it has no effect when I add this property to vl-interaction-select component.

Some investigations:

  1. I opened source code for ol/interaction/Select.js and changed hitTolerance_ value to 90. After that I got the behavior that was required.
  2. I opened source code for vuelayers/lib/select-interaction/index.js and added hitTolerance: this.hitTolerance, in new SelectInteraction({...}) constructor. After that I also got the behavior that was required.

Example of my code is shown below:

<vl-map ref="map" data-projection="EPSG:4326" @mounted="onMapMounted" :move-tolerance="10">
      <vl-view ref="view" :enable-rotation="false"></vl-view>
      <vl-interaction-select :features.sync="selectedFeatures" :hit-tolerance="90">
            <template slot-scope="select">
            ...
           </template>
      </vl-interaction-select>
</vl-map>
...

If i'm wrong, could you explain how to use this property? I can't find any examples in an official docs.


Vuelayers 0.11.16, Vue 2.6.10.

@ghettovoice
Copy link
Owner

Hello @betanets ,
looks like I forgot to add it to the constructor call.
I'll fix this soon.

Thanks for response!

@ghettovoice ghettovoice self-assigned this Nov 5, 2019
@ghettovoice ghettovoice added the bug label Nov 5, 2019
ghettovoice added a commit that referenced this issue Nov 5, 2019
@ghettovoice
Copy link
Owner

Fixed in v0.11.17

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

Successfully merging a pull request may close this issue.

2 participants