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.

1 Answer 1


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.

  • (3+ years ago, but).. What did you find difficult with move handling? I've added an SVG layer that moves and zooms with the map, and once I knew how to insert it (please ask) all event handling seems to happen automatically correctly. No custom handlers were required.
    – akauppi
    Nov 3, 2014 at 7:26
  • I'm not sure I recall, but I suspect it is loading and paging new objects that were not visible. If you just draw all the objects offscreen you wouldn't have to worry about that. Polymaps is end of life, btw, you should probably switch to something newer like Leaflet.
    – Nelson
    Nov 4, 2014 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.