CartoDB / mobile-carto-libs

Internal dependencies for CARTO Mobile SDK
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

changing ` marker-file` makes it disappear #32

Open farfromrefug opened 2 years ago

farfromrefug commented 2 years ago

I have a style rule like this: marker-file: [nuti::selected_id]=[id]? url(symbols/pin_selected.svg): url(symbols/pin.svg); Once i select the marker it disappears. When i unselect it it reappears. If i use symbols/pin_selected.svg for unselected it works.

BTW i use this because marker-line-x does not work with bitmaps/svgs. I get it is tricky but do you think it would be possible to make it work? we could scale the bitmap for the stroke, colorize it and draw it before actually drawing the image?

mtehver commented 1 year ago

Most likely you have something wrong with your ids (for example, if you use GeoJSON, you need to use numeric ids, not strings as GeoJSON is converted internally into MVT and MVT only supports numeric ids).

Regarding marker-line-x properties, I need to check if it is possible to implement this easily. SDK uses NanoSVG for rendering SVGs into bitmaps and I am not currently sure how to do this.

farfromrefug commented 1 year ago

@mtehver i dont think it is an id issue since the issue happens on selected thus when [nuti::selected_id]=[id] returns true. It works other wise which means (if i am not wrong ) that carto sees the change and tries to change the marker-file. If something was wrong with my id then [nuti::selected_id]=[id] should always return false thus i should always see url(symbols/pin.svg)

mtehver commented 1 year ago

@farfromrefug I did a basic test and it worked as expected. There is nothing special about this expression/property/markers, so I can not think of anything other that could cause this. If you could make a small minimal test I could take a closer look.

farfromrefug commented 1 year ago

@mtehver thanks for testing! I will dig deeper into this