bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
495 stars 235 forks source link

Custom category markers with list icons #142

Closed subindesign closed 8 years ago

subindesign commented 8 years ago

This is a fantastic plugin, Thank you sincerely for all of your work.

https://bjornblog.com/storelocator/v2/category-markers-example.html

Based on your Custom category markers example above.

Can I change list icons matching the custom category markers instead A,B,C?

<div class="list-label">{{marker}}</div>

<div class="list-label">{{catMarkers}}</div> <-- does not work

skitch 2016-08-04 15-26-00

bjorn2404 commented 8 years ago

catMarkers is not output to the templates and it wouldn't work if it was because the markers are set up using the Google Maps API with the provided images. If you have multiple categories per location I'm not sure what the best route would be. If you're using one category per location you could use {{category}} in the list label class attribute or make a new data-category="{{category}}" attribute. Then set a background image from it in CSS. However, you'd probably also want to create a custom Handlebars helper to make the category name a "slug" - avoiding uppercase letters and spaces. An example of a Handlebars helper can also be seen in the 169 of the plugin with the niceURL helper.