Skip to content

Commit

Permalink
Added a new icon for adding nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevers committed Jun 21, 2013
1 parent fd11a5e commit 521a56b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
17 changes: 12 additions & 5 deletions res/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
height:700px;
}

.leaflet-control-geoloc {
background-image: url(/res/img/location.png);
background-position:
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}

.leaflet-control-node {
background-image: url(/res/img/node.png);
background-position:
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}



Expand Down Expand Up @@ -92,11 +104,6 @@
background: #F7F7F7;
}
.leaflet-control-geoloc {
background-image: url(/res/img/location.png);
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
#inputform i {
font-size: 10px;
Expand Down
Binary file added res/img/node.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/js/loadmap.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ var geolocControl = new L.control({
position: 'topright'
});

var addNode = new L.control({
position: 'topright'
});

$(document).ready(function() {
$.ajaxSetup({cache:true});

Expand All @@ -31,10 +35,17 @@ $(document).ready(function() {
return div;
};

addNode.onAdd = function (map) {
var div = L.DomUtil.create('div', 'leaflet-control-zoom leaflet-control');
div.innerHTML = '<a class="leaflet-control-node" href="#" onclick="merp(); return false;" title="Add node"></a>';
return div;
};

// Populate the map with nodes from /api/all.
addNodes();

map.addControl(geolocControl);
map.addControl(addNode);
map.addControl(new L.Control.Scale());

//map.locate({setView: true, maxZoom: 3});
Expand Down
4 changes: 2 additions & 2 deletions res/webpages/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>{{.Name}}</title>
<link rel="shortcut icon" href="/res/img/favicon.png">
<link rel="shortcut icon" href="res/img/favicon.png">
<!-- CDN w/o local fallbacks will need to be addressed -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/2.3.1/flatly/bootstrap.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.min.css" rel="stylesheet">
Expand All @@ -17,7 +17,7 @@
<script type="text/javascript" src="res/js/leaflet.markercluster.js"></script>
</head>
<body>
<div id="map"></div>
<div id="map"></div>
<script type="text/javascript" src="res/js/loadmap.js"></script>
</body>
</html>

0 comments on commit 521a56b

Please sign in to comment.