GithubHelp home page GithubHelp logo

Comments (5)

mbostock avatar mbostock commented on July 28, 2024

I see. Yes, the KML transcoder wasn't setting the type "FeatureCollection" on the GeoJSON. I've fixed that in my local branch and it will be in the next release. In the meantime, please feel free to patch this into your code:

http://github.com/mbostock/polymaps/commit/7033e1cace8956fbd96fc706b719468cd8a95fbc

from polymaps.

arktisma avatar arktisma commented on July 28, 2024

Cool, thanks, it's working now.

I have another small problem - If I have lines that cross the equator, they scale oddly. I'm not sure what the technical name for it is, so here is a screengrab: http://tinyurl.com/22vubba

from polymaps.

mbostock avatar mbostock commented on July 28, 2024

Hmm, yes, that's an interesting problem. The issue is not the equator, but that your points cross -180° longitude, wrapping around to +180°. I suppose the right thing to do here is to detect this wrap-around case when projecting LineStrings (and Polygons). You could try patching that in your data (subtracting 360° for the longitude for the coordinates currently displayed on the right), as a temporary fix.

from polymaps.

arktisma avatar arktisma commented on July 28, 2024

Sorry, equator... I meant to say date line.... I'll have a look at patching my data...

Last question... In my KML data, I have tags. Curiously, if I hover a mouse long enough over each placemark (the small dots in the image above), I actually get my coming up as a sort of alt-tag. How can I capture that, and style it as a tooltip, or a popup? Here is what I mean: http://tinyurl.com/2wdbfea

from polymaps.

mbostock avatar mbostock commented on July 28, 2024

Right, that part is implemented in kml.html in a load handler, using the name and description properties of your data:

f.element.appendChild(po.svg("title").appendChild(
    document.createTextNode(p.name + ": " + p.description))
    .parentNode);

If you want to style it as a more flexible (HTML) popup, take a look at the Tipsy example:

http://github.com/mbostock/polymaps/tree/master/examples/tipsy/

Tipsy is a plugin for jQuery that provides "Facebook-style" tooltips. The Tipsy example above activates the tooltip on click, similar to Google Maps, but you could also activate it on mouseover. Or do something like find the closest point to the mouse, and show the tooltip for that. If I have some time this weekend I'll try to put together a better example of this.

The other thing to look at is the new marker example which I'm developing, showing how to use custom SVG:

http://github.com/mbostock/polymaps/tree/master/examples/marker/

In your case, though, sounds like you're more interested in rich popups rather than custom marker display. But the vector markers with gradients are pretty so I thought I'd share. :)

from polymaps.

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.