mapbox - Adding marker Bounce and Drop effect to markers on map box -


i new map box api, , have been using google maps api earlier. anyways, issue need give marker on mapbox, drop animation when marker appears on map , once user starts drag marker, need give bounce animation until drag ends. have gone through api docs couldn't find relevant. have tried bouncemarker.js give these markers bounce effect, unfortunately doesn't fulfill requirement bounce effect not smooth enough good. so, or suggestions in regard appreciated.

my code far looks this,

    l.mapbox.accesstoken = '[access token]';     map = l.mapbox.map('googlemap',                     'map_id', {                          center: [-8.461, 115.159],                         zoom: 9                     });     marker = l.marker(latlongobj, {         icon: l.icon({ iconurl: marker_image }),         draggable: true     });     marker.addto(map);       marker.on('dragstart', function(e) {         console.log('drag start!');     });      marker.on('dragend', function(e) {         console.log('drag end!');     }); 

thanks

you can use seticon on l.marker dynamically switch marker's icon on cue of whatever events want. assume 2 icons, var bouncingicon = xxxxx , var nonbouncingicon = xxxx, , set needed - mymarker.seticon(nonbouncingicon).


Comments