-
Notifications
You must be signed in to change notification settings - Fork 42
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
Swiss map does not fit in leaflet #28
Comments
By default, the generated TopoJSON uses a different coordinate system than Leaflet. Set See https://github.com/interactivethings/swiss-maps/blob/master/README.md#projections-and-dimensions and https://github.com/interactivethings/swiss-maps/blob/master/README.md#reproject-to-spherical-coordinates in particular. |
Oh my god, thank you for your help. I forgot to include the reprojection when I typed |
Oh my god, thank you for your help. I forgot to include the reprojection when I typed |
I want to add a layer with the map of the canton "Thurgau". I am using the code from https://gist.github.com/zross/11186669, which does display the state of california. This is the my version of the javascript code. I have changed the variables according to the topojson "tg-municipalities-lakes.json".
`var map = new L.Map("map", {center: [37.8, -96.9], zoom: 1})
.addLayer(new L.TileLayer("http:https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"));
First, it did not display the d3.js layer. But after that I am playing with the scale and translate of the json file and tested a lot of variants. The latest version of the json file is:
"transform":{"scale":[0.0108,0.0045],"translate":[1840,4700]}
and
Currently it looks like this:
![bildschirmfoto 2017-12-22 um 17 46 19](https://user-images.githubusercontent.com/20162405/34306254-89ca571e-e742-11e7-9dd0-72578a287f1a.png)
As you can see, the d3 map does not fit in well. How can I place "tg-municipalities-lakes.json" on the openstreetmap easily without making any gaps?
The text was updated successfully, but these errors were encountered: