Skip to content

Commit

Permalink
Merge pull request #5 from initbiz/fix-default-icon
Browse files Browse the repository at this point in the history
Fix default icon
  • Loading branch information
tomaszstrojny authored Apr 29, 2020
2 parents 91edc60 + 1a372d0 commit 205de6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion components/partials/markers.htm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
#}
{% else %}
<script>
L.Icon.Default.prototype.options.iconUrl = '{{ __SELF__.getMarkerIconUrl()|app }}';
{% if __SELF__.getMarkerIconUrl() %}
let DefaultIcon = L.icon({
iconUrl: '{{ __SELF__.getMarkerIconUrl()|media }}',
iconSize: [40,40],
});
L.Marker.prototype.options.icon = DefaultIcon;
{% endif %}

{% for marker in __SELF__.markers %}
L.marker([{{ marker.lat }}, {{ marker.lon }}])
Expand Down
2 changes: 1 addition & 1 deletion lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'label' => 'LeafletPro',
'description' => 'LeafletPro general settings',
'general_tab' => 'General',
'marker_icon_url' => 'Full URL of the default marker icon',
'marker_icon_url' => 'Select the icon from the mediafinder',
'resolvers_tab' => 'Resolvers',
'nominatim_url' => 'URL of Nominatim service',
'nominatim_url_comment' => 'Read more info about Nominatim service <a href="https://operations.osmfoundation.org/policies/nominatim/" target="_blank">here</a>',
Expand Down
3 changes: 1 addition & 2 deletions models/settings/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ tabs:
marker_icon_url:
label: initbiz.leafletpro::lang.settings.marker_icon_url
tab: initbiz.leafletpro::lang.settings.general_tab
type: text
type: mediafinder
span: left
default: '/plugins/initbiz/leafletpro/assets/node_modules/leaflet/dist/images/marker-icon.png'
nominatim_url:
label: initbiz.leafletpro::lang.settings.nominatim_url
commentAbove: initbiz.leafletpro::lang.settings.nominatim_url_comment
Expand Down

0 comments on commit 205de6f

Please sign in to comment.