-
Notifications
You must be signed in to change notification settings - Fork 212
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
How to disable wrap-around? #129
Comments
Try map.centerRange and url.repeat. |
@mbostock Thanks for the pointers. Using Assuming not, I'm using |
Heh, upon further inspection, it appears that by setting Here's basically what I'm doing (simplified and converted from coffeescript to JS): po = org.polymaps
map = po.map()
svg = po.svg("svg")
container.append(svg)
map.container(svg)
.zoomRange([0,2])
.zoom(0)
.add(po.drag())
.add(po.dblclick())
.add(po.wheel())
.center({lat: 40, lon: 10})
mapGeoJson = po.geoJson()
.url(po.url("/countries.geo.json").repeat(false))
.tile(false)
map.add(mapGeoJson)
map.on("move", <centerRange hackery>)
map.on("resize", <more centerRange hackery>) |
Is there a solid solution for this problem? In Google Maps you can keep the map from repeating by using a custom Projection, but I can't figure out how to do something similar with Polymaps. |
Bump+ |
Bump! |
For anyone still wondering about this, I ended up switching to using Leaflet JS for mapping. It includes a Simple CRS setting to remove the wrapping of maps like this, solving the problem. I'm sure this isn't what Polymaps dev's want to hear, but there it is. |
Well, there aren't really any active Polymaps developers at this point. At Stamen we're using Leaflet for everything these days, so no offense taken here. |
Hi @Jakobud how did you did do that in google maps? Might be useful to figure out how to do that here. |
I'm working on a polymaps visualization containing only a simple geoJSON layer. When panning left or right, when the antimeridian (180/-180 longitude) crosses the center of the viewport, Polymaps wraps around. This has the visual effect of the whole map jumping to the left/right by 360 degrees.
Any suggestions for working around this? I'd really like to be able to pan until the visible layer is off the screen, even if it means that the virtual "center" of the map is, say, 300 degrees. I'm thinking there might be some hackaround where you can prevent polymaps from hiding the first layer and showing the second layer when it tries to wrap, but I haven't been able to figure that out either.
The text was updated successfully, but these errors were encountered: