Skip to content

Commit

Permalink
marker-icon.svg.template: remove (use inline svg symbol instead)
Browse files Browse the repository at this point in the history
Remark: currently the marker is used in:
- search.js
- distance-to-portal.user.js
- draw-tools.user.js
  • Loading branch information
johndoe committed Feb 6, 2019
1 parent 6c1df56 commit 6d01a62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
8 changes: 8 additions & 0 deletions code/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ window.setupStyles = function() {

window.setupIcons = function() {
$(['<svg>',
// search.js, distance-to-portal.user.js, draw-tools.user.js
'<symbol id="marker-icon" viewBox="0 0 25 41">',
'<path d="M1.36241844765,18.67488124675 A12.5,12.5 0 1,1 23.63758155235,18.67488124675 L12.5,40.5336158073 Z" style="stroke:none;" />',
'<path d="M1.80792170975,18.44788599685 A12,12 0 1,1 23.19207829025,18.44788599685 L12.5,39.432271175 Z" style="stroke:#000000; stroke-width:1px; stroke-opacity: 0.15; fill: none;" />',
'<path d="M2.921679865,17.8803978722 A10.75,10.75 0 1,1 22.078320135,17.8803978722 L12.5,36.6789095943 Z" style="stroke:#ffffff; stroke-width:1.5px; stroke-opacity: 0.35; fill: none;" />',
'<path d="M19.86121593215,17.25 L12.5,21.5 L5.13878406785,17.25 L5.13878406785,8.75 L12.5,4.5 L19.86121593215,8.75 Z M7.7368602792,10.25 L17.2631397208,10.25 L12.5,18.5 Z M12.5,13 L7.7368602792,10.25 M12.5,13 L17.2631397208,10.25 M12.5,13 L12.5,18.5 M19.86121593215,17.25 L16.39711431705,15.25 M5.13878406785,17.25 L8.60288568295,15.25 M12.5,4.5 L12.5,8.5" style="stroke:#ffffff; stroke-width:1.25px; stroke-opacity: 1; fill: none;" />',
'</symbol>',

// Material Icons

// portal_detail_display.js
Expand Down
6 changes: 1 addition & 5 deletions code/utils_misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,18 +444,14 @@ window.clampLatLngBounds = function(bounds) {
return new L.LatLngBounds ( clampLatLng(bounds.getSouthWest()), clampLatLng(bounds.getNorthEast()) );
}

window.getGenericMarkerSvg = function(color) {
var markerTemplate = '@@INCLUDESTRING:images/marker-icon.svg.template@@';

return markerTemplate.replace(/%COLOR%/g, color);
}

window.getGenericMarkerIcon = function(color) { // used in draw-tools
color = color || '#a24ac3';
return L.divIcon({
iconSize: [25, 41],
iconAnchor: [12, 41],
html: getGenericMarkerSvg(color),
html: '<svg width="25px" height="41px" style="fill: ' + color + '"><use xlink:href="#marker-icon"/></svg>',
className: 'leaflet-div-icon-iitc-generic-marker', // actually any name, just to prevent default
// (as it's inappropriately styled)
// for draw-tools:
Expand Down
12 changes: 0 additions & 12 deletions images/marker-icon.svg.template

This file was deleted.

0 comments on commit 6d01a62

Please sign in to comment.