carto.js
carto.js copied to clipboard
onFeatureOver triggered outside image using shield-file and transform function for points
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
- Create layer of points and render them using images with
shield-file: url(...)
. - Scale the image in different levels of zoom using
shield-transform: scale(.5, .5)
,shield-transform: scale(.1, .1)
... whatever. - 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.