Take the 2-minute tour ×

I wanted to add a custom marker to my demo: http://drewwells.net/craigmaps/

Instead, I had to make a red dot to specify the place I wanted. Adding an image seems to want to layer that, but all I want is to stick the center of an icon to a lon/lat I specify.

On the same topic, is there any other way to put a point on the map than setting up a geoJSON with geometry set to point. This seemed counterintuitive, but was the only way I could figure it out with just the docs and demo to go buy.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The easy way to add features to a map in Polymaps is via GeoJSON. You can then use Javascript to go in and modify the mark: here's a working example of simple image replacement. Basically the code replaces the GeoJSON circles with svg:image tags.

It's also possible to directly add things to the Polymaps SVG structure in your own code. You will want to use the Polymaps method locationPoint() to translate lat/lon to screen coordinates. This works great until you need to move or zoom the map; it's a bit of a challenge to implement move handling correctly. A third option is to build a custom po.layer(), see the tiles example.

share|improve this answer
Yay! Extremely helpful! Thanks! :-) –  Till May 6 '11 at 11:53
add comment

Your Answer


