leaflet 0.4 compliant markers and icons

This commit is contained in:
DennisSchiefer
2012-08-14 12:39:26 +01:00
parent ea84f774a7
commit 6c2e391622
9 changed files with 205 additions and 127 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ OSRM.Marker = function( label, style, position ) {
this.label = label ? label : "marker";
this.position = position ? position : new L.LatLng(0,0);
this.marker = new L.MouseMarker( this.position, style );
this.marker = new L.LabelMarker( this.position, style );
this.marker.parent = this;
this.shown = false;
@@ -101,7 +101,7 @@ onDrag: function(e) {
onDragStart: function(e) {
OSRM.GUI.deactivateTooltip( "DRAGGING" );
OSRM.G.dragging = true;
this.switchIcon(this.options.dragicon);
this.changeIcon(this.options.dragicon);
// store id of dragged marker
for( var i=0; i<OSRM.G.markers.route.length; i++)
@@ -119,7 +119,7 @@ onDragStart: function(e) {
},
onDragEnd: function(e) {
OSRM.G.dragging = false;
this.switchIcon(this.options.baseicon);
this.changeIcon(this.options.baseicon);
this.parent.setPosition( e.target.getLatLng() );
if (OSRM.G.route.isShown()) {