Comments (5)
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.
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.
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.
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.
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)
- Upgrade polymaps.org to 2.5.1 -- Currently examples breaking in IE9/Firefox HOT 2
- 'show' event is called with bad data the first time
- How to disable wrap-around? HOT 9
- Load function should be called with layer as context
- Polymaps has stopped working in Firefox HOT 3
- Maps start jumping in Chrome when dragging
- Custom Coordinate systems or Projects? HOT 2
- Round up in fractional zooming
- Examples don't work in firefox HOT 4
- [enhancement] Add missing bower.json. HOT 1
- SOURCE CODE FOR IMAGE MAP USED IN NEWSPAPER HOT 1
- Attaching event listeners to geoJson layer HOT 1
- Navigation image viewport
- Overlays
- Examples on http://polymaps.org/ex/ not resizing. HOT 3
- how to add custom icons on locations and toolip on those
- Integrating polyMaps with angular2 webpack
- Using Polymaps with Mapbox
- Examples on website no longer work because of CORS
- Is polymaps dead ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polymaps.