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

Selectively disable drawAltitude for compound markers #2325

Closed
joric opened this issue May 11, 2024 · 0 comments
Closed

Selectively disable drawAltitude for compound markers #2325

joric opened this issue May 11, 2024 · 0 comments

Comments

@joric
Copy link

joric commented May 11, 2024

First of all, I've managed to solve a bunch of problems already.

But there's an unsolvable with drawAltitude - when you use compound markers, i.e. symbol: [ {..}, {..} ] with different markerDy, it draws SEVERAL vertical lines, one for each marker.

I CANNOT use separate layers, because Z-sorting doesn't work across layers, and I need Z-sorting for markers.

It would be great to disable altitude by symbol, because separating markers into different layers cause all sorts of issues (weird overlap, etc. as depth sorting doesn't work across layers).

Example: https://joric.github.io/supraland/3d

var marker = new maptalks.Marker([o.lng, o.lat, o.alt],{
  symbol: [
    {
      markerWidth: 75,
      markerHeight: 75,
      markerType: 'pin',
    },
    {
      markerFile: 'icon.png',
      markerWidth  : 32,
      markerHeight : 32,
      markerDy: -22,
    },
  ],
}).addTo(vectorLayer);

It draws two altitude lines for the marker. I think it should allow customizing altitude display (and color) for each symbol.
I thought maybe options could be callable, so we could use dynamic colors, but it doesn't work this way.

//    vectorLayer.setOptions({drawAltitude : {lineWidth : 3, lineColor : '#888' }});
    vectorLayer.setOptions({drawAltitude : (e)=>{lineWidth : 3, lineColor : getColor(e) }});

Also it may be useful to customize altitude drawing for lineString, I need only the last point. It is fixable with multiple layers, because Z-sorting doesn't matter for lines, but it would need an extra layer for endpoints only.

Upd. OK I realized I can do that with just 1 extra layer because I don't really need to sort lines by depth. Closing.

@joric joric changed the title Disable altitude for 2d (parallax mode) Selectively disable drawAltitude for compound markers May 13, 2024
@joric joric closed this as completed May 25, 2024
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