Giter Site home page Giter Site logo

Comments (4)

manubb avatar manubb commented on May 23, 2024

Hi.
It is possible that i'm using topojson a bit weirdly (it's been a while and i do not remember clearly).
However, the demos use Leaflet default projection which expects 4326 coords.
The example you are giving use d3.geo.albersUsa projection so bad results can be expected when using Leaflet default projection.

Can you give me a topojson sample (using 4326 coords) so that i can have a look?

from leaflet.pixioverlay.

pere avatar pere commented on May 23, 2024

thanks for this fast answer

I am not sure the json i sent you is on Albers, I think is transforming to Albers from a spherical (geographical) coordinates, that is 4326... but I have never been good on projections
link

In any case here, on the EU comission official webpage can download different Topojson polygonal layers at different projections, including 4326. I cannot send here any example JSON, please download from the site.

I send also a screenshot of my result with one of these json. Of course I had to change a few things on code to generate it, but with this code and your french topojson it works. So, should work for others topojsons...

topojson_incorrect

I think the plugin has a great potential, dreaming on creating color transitions on polygons on changing various parameters... any help appreciated

I suggest to add as base layer a grey map (see below), because maybe generated (weird) polygons are not very visible.

 var grayLayer =L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {
  attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="https://carto.com/attributions">CARTO</a>',
  subdomains: 'abcd',
  maxZoom: 19
}).addTo(map);

from leaflet.pixioverlay.

manubb avatar manubb commented on May 23, 2024

I think you are right for the coordinate system of d3 demo.
I have added a basic demo to display the US states:
https://manubb.github.io/Leaflet.PixiOverlay/simple-topojson.html
The sources are in the doc directory. Hope this will help you.

from leaflet.pixioverlay.

pere avatar pere commented on May 23, 2024

This is great! thanks a lot

from leaflet.pixioverlay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.