This example shows how to add text labels to GeoJSON point features in Polymaps. We create a new svg:text
element and insert it as a following sibling to the default svg:circle
element provided by the GeoJSON layer. The “dy” and “text-anchor” attributes are used to center the text horizontally and vertically.
Implementation Note: This example depends on the circle element’s “transform” attribute. In release 2.2.0, the circle element used the “cx” and “cy” attributes instead. Release 2.3.0 will use the “transform” attribute and is available in my personal fork.
Updated missing url https://cdn.rawgit.com/mbostock/polymaps/2142f192bc527e4cb17a113ef46219bf1999b269/polymaps.min.js to https://cdn.jsdelivr.net/gh/mbostock/polymaps/2142f192bc527e4cb17a113ef46219bf1999b269/polymaps.min.js
Updated missing url https://cdn.rawgit.com/mbostock/polymaps/2142f192bc527e4cb17a113ef46219bf1999b269/lib/crimespotting/crimespotting.js to https://cdn.jsdelivr.net/gh/mbostock/polymaps/2142f192bc527e4cb17a113ef46219bf1999b269/lib/crimespotting/crimespotting.js
https://cdn.rawgit.com/mbostock/polymaps/2142f192bc527e4cb17a113ef46219bf1999b269/polymaps.min.js
https://cdn.rawgit.com/mbostock/polymaps/2142f192bc527e4cb17a113ef46219bf1999b269/lib/crimespotting/crimespotting.js