locked
What is most optimal and fastest loading pushpin - svg vs png vs dynamically craeted svg or canvas icons from font RRS feed

  • Question

  • What would be the most speedy in terms of loading icons for pushpins to use? I have from 5 to 100 pin on map usually(some clustered) and single pushpins based on data from database (color, shape) - 5 colors, 5 shapes combinations. I can just use png(create 25 png files and set icons depending on color and shape). I can use dynamic svg and pass color in it or I can use canvas from font and pass color in function as well. what is best for loading on map - fastest?
    Thanks,
    Wednesday, August 31, 2016 10:03 PM

Answers

  • If you preload images so that the browser cached them that may be slightly faster when initially creating the pushpins, but after that it won't make much of a difference. A 100 pushpins isn't a lot. V8 can currently handle 1,000 and we are working to add support for a lot more. If you want the fastest performance a custom overlay and drawing simple shapes on a canvas would support 50,000+ pushpins but that is likely overkill. Given your requirements I would keep it simple and either use the default pushpin which supports changing the color, or use an inline svg with a color placeholder. This will allow you to reuse a single svg and the color pushpin option.

    [Blog] [twitter] [LinkedIn]

    Thursday, September 1, 2016 2:57 AM