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

Rotate Markers #179

Open
nolatron opened this issue Nov 25, 2020 · 1 comment
Open

Rotate Markers #179

nolatron opened this issue Nov 25, 2020 · 1 comment

Comments

@nolatron
Copy link

Anyone able to get the Rotated Marker plugin to work with the Realtime Plugin? Its working my static map but trying to see if the realtime map will do use it as well for a flight sim tracker.

Here's my current code:

function createRealtimeLayer(url, container) {
    return L.realtime(url, {
        interval: 30 * 1000,
        getFeatureId: function(f) {
            return f.properties.pilot_num;
        },
        cache: true,
        container: container,
        onEachFeature (f,l) {
            l.setZIndexOffset(200);
            l.setIcon(IconPlayer);            
        }
    });
}

I tried l.setIcon(IconPlayer, rotationAngle:45);

and l.setIcon({IconPlayer, rotationAngle:45});

even tried adding l.rotationAngle(45);

but none worked.

@CarlosSprekelsen
Copy link

It works for me, try l.setRotationAngle(rotationangle);

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

2 participants