add core functions to create a generic marker icon, of a specified colour.

use it for the new portal distance current location marker, and search result marker
This commit is contained in:
Jon Atkins
2015-02-21 17:08:04 +00:00
parent e03bbf50f1
commit badcdbdb18
3 changed files with 30 additions and 21 deletions

View File

@ -137,15 +137,8 @@ window.search.Query.prototype.onResultSelected = function(result, ev) {
result.layer = L.layerGroup();
if(result.position) {
var markerTemplate = '@@INCLUDESTRING:images/marker-icon.svg.template@@';
L.marker(result.position, {
icon: L.divIcon({
iconSize: new L.Point(25, 41),
iconAnchor: new L.Point(12, 41),
html: markerTemplate.replace(/%COLOR%/g, 'red'),
className: 'leaflet-iitc-search-result-icon',
}),
title: result.title,
createGenericMarker(result.position, 'red', {
title: result.title
}).addTo(result.layer);
}