1

This is a hard one for me to search on. I have an object that I populate jvectormap points with:

dealers[d]["latLng"] = coords;
dealers[d]["name"] = variable1 + '<br>' + Math.round(variable2);
dealers[d]["style"] = style;

but when I pass the object into jvectormap the labels show up with <br> in text and do not give me a line break.

var mapObject = $('#vmap').vectorMap('get', 'mapObject');
mapObject.addMarkers(dealers, []);

Is there anyway to mark the <br> as HTML within the object so that jvectormap treats it as a break in the label and not as straight text?

Anthony Grist
  • 38,173
  • 8
  • 62
  • 76
whreed
  • 133
  • 1
  • 11
  • I've never used jvectormap, but what about trying `\n` instead? – Chris Farmer May 01 '13 at 14:27
  • was the "
    " stripped off or encoded as entities?
    – mauris May 01 '13 at 14:27
  • 2
    this may help https://github.com/bjornd/jvectormap/issues/55 or this: http://stackoverflow.com/questions/12937946/jvectormap-how-to-implement-html-instead-of-simple-string-in-the-markers-label – Pete May 01 '13 at 14:28
  • This is after the map loads and I zoom into a state...the example you gave me in the second link is when you initially create the map, I need to do this after you drill into a state. Now the first link might be the way I have to go, I have to add it in the original source code and build my own version of jvectormap. – whreed May 01 '13 at 14:42
  • @Pete your second link answered my question...in there is a link to a flag example which helped me do this...I can't find how to mark your comment as the answer! – whreed May 01 '13 at 15:04
  • @whreed you can't mark a comment as an answer, I can add an answer if you want to mark it – Pete May 01 '13 at 15:14

0 Answers0