Support for bootstrap glyph icons in YMaps GeoObject
-
Put module source code (
glyphIcon-preset.min.js
) on your CDN. -
Load both Yandex Maps JS API 2.1 and module source code by adding following code
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU"></script>
<script src="glyphIcon-preset.min.js"></script>
- Get access to module functions by using ymaps.modules.require method
ymaps.modules.require(['preset.glyphIcon'], function () {
var placemark = new ym.Placemark(
map.getCenter(),
null,
{
preset: 'preset#glyphIcon',
iconGlyph: 'play'
});
map.geoObjects.add(placemark);
});
Parameter | Default value | Decription |
---|---|---|
iconGlyph |
- | glyph name, see BOOTSTRAP GLYPHICONS) |
iconGlyphColor |
inherited | color, supports HEX, RGB notation |
iconGlyphSize |
inherited | size number |
http://effrenus.github.io/glyphicon-preset/
Use ymb if re-build is needed.