Skip to content
This repository has been archived by the owner on Jul 5, 2018. It is now read-only.

Commit

Permalink
Merge pull request #125 from jdlrobson/pins-119
Browse files Browse the repository at this point in the history
provide custom markers for map
  • Loading branch information
bvibber committed Aug 14, 2012
2 parents f97cfdd + 004fd21 commit 9b1be5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Binary file added assets/www/images/pin-no-photos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/www/images/pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion assets/www/js/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,18 @@ define(['jquery', '../leaflet/leaflet-src', 'leafclusterer'], function() {
}

function addMonument(monument, onClick) {
var marker = new L.Marker(new L.LatLng(monument.lat, monument.lon));
var url = 'images/', iconOptions;
url += monument.image ? 'pin.png' : 'pin-no-photos.png';
if ( L.VERSION === '0.3' ) { // TODO: upgrade leaflet to 4.0
iconOptions = url;
} else {
iconOptions = {
iconUrl: url,
iconSize: [ 30, 50 ]
};
}
var markerIcon = new L.Icon( iconOptions );
var marker = new L.Marker( new L.LatLng( monument.lat, monument.lon ), { icon: markerIcon } );
var popup = "<div><strong>" + monument.name + "</strong></div>";
var popupDOM = $(popup).click(function() {
onClick(monument);
Expand Down

0 comments on commit 9b1be5a

Please sign in to comment.