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

Can't set map view max zoom #44

Open
you-randomly opened this issue Feb 20, 2023 · 2 comments
Open

Can't set map view max zoom #44

you-randomly opened this issue Feb 20, 2023 · 2 comments

Comments

@you-randomly
Copy link

changing the maxZoom view setting on a map view orb container has no effect

        const container = document.getElementById('graph');
        const orb = new Orb.Orb(container);
        orb.setView((context) => new Orb.MapView(context, {
            getGeoPosition: (node) => ({ lat: node.data.lat, lng: node.data.lng, }),
        }));
        orb.view.setSettings({
            map: {
                zoomLevel: 9,
            },
            render: {
                maxzoom: 20,
            },
        });

I'd expect the above would allow the user to zoom all the way to zoom level 20 on the map

however this doesn't seem to the be the case as this has no affect on the test sie i have setup

I'm guessing these settings maybe only affect the default view?

@tonilastre
Copy link
Contributor

Good guess, the maxZoom property is currently part of the renderer settings, but in a map view environment, map becomes the primary renderer in a sense of settings and the environment.

As we haven't yet added a better sync between renderer zoom levels and map zoom levels (e.g. when you zoom in, the node size stays the same which should not be the case), the orb exposes the leaflet instance so you can do any customization on it.

Get the leaflet instance with orb.view.leaflet (Docs reference) and with it you can do any customization that Leaflet has, including maxZoom for the map: https://leafletjs.com/reference.html#map-maxzoom

@katarinasupe
Copy link

Hi @you-randomly, did @tonilastre's suggestion help you resolve the issue you were experiencing?

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

3 participants