markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Custom markers #181

Closed wadjo closed 9 years ago

wadjo commented 9 years ago

Hi, Thank you for releasing DataMaps ! I appreciate your efforts. But please can we provide an image instead of the bubbles ? Hope there is a solution ...

Thanks !

markmarkoh commented 9 years ago

@wadjo I whipped up a custom plugin for your to mess around with, here is the working example:

http://jsbin.com/pamigahifi/1/edit?html,output

Notes:

  1. Custom URLs can be passed in for each marker
  2. You can set a default
  3. Markers are hard coded to 20x20px, this can be easily changed by updated the handleMarkers function

You can play around with handleMarkers as much as you feel necessary to get this plugin to your likings.

Last note: This is not part of DataMaps core - this is just using DataMap's plugin system

screen shot 2015-04-19 at 3 12 31 pm