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

onFeatureOver triggered outside image using shield-file and transform function for points #2255

Open
mondeja opened this issue Mar 29, 2021 · 0 comments

Comments

@mondeja
Copy link

mondeja commented Mar 29, 2021

Context

I've some points rendered by PNG images using shield-file CartoCSS property. Their images are downscaled using shield-transform: scale() function, with values lower than 0. The problem is that the onFeatureOver event is triggered outside the bounds of the shield, and only is triggered in the bounds using scale(1, 1).

There is another way to scale shields without this function?

Steps to Reproduce

  1. Create layer of points and render them using images with shield-file: url(...).
  2. Scale the image in different levels of zoom using shield-transform: scale(.5, .5), shield-transform: scale(.1, .1)... whatever.
  3. Listen to onFeatureOver, change the zoom of the map and moves the mouse around the bounds of the images.

Current Result

onFeature... events are not triggered properly.

Expected result

Trigger onFeatureOver and onFeatureOut in the bounds of the images, even if transform functions are used.

Browser and version

All browsers, latest version of carto.js

Additional info

I'm not sure if this is the correct way to render points using raster images. It is? If not, do you know another? I've tested markers using SVG files for these images, but I can't render those correctly, are rendered using one color for the border and other for the fill. That's is the reason why I am rendering them using shields.

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

1 participant