Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made distribution of route plugin

  • Loading branch information...
commit c81461f994b7af24938058534c3a768c098ce5d5 1 parent 8b28ea6
Massimiliano Marcon authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  dist/extensions/route.min.js
2  dist/extensions/route.min.js
View
@@ -1 +1 @@
-(function(e){function i(e){return e instanceof Array?{latitude:e[0],longitude:e[1]}:e}var t,n,r={type:"shortest",transportMode:"car",options:"",trafficMode:"default",width:4,color:"#ff6347",marker:{text:"#",textColor:"#fff"}};n=function(n,s,o){var u,a,f,l;t=t||nokia.maps,n=i(n),s=i(s),o=e.extend({},r,o),f=function(n,r,i){var s,u,a,f,l,c={},h;i==="finished"?(s=n.getRoutes(),f=s[0],a=new t.map.Polyline(f&&f.shape,{pen:new t.util.Pen({lineWidth:o.width,strokeColor:o.color})}),u=new t.map.Container,u.objects.add(a),e.each(f.waypoints,e.proxy(function(t,n){var r=e.extend({},o.marker);o.marker.text==="#"&&(r.text=t+1),this.marker(n.originalPosition,r)},this)),this.map.objects.add(u),l=f.legs&&f.legs.length&&f.legs[0],c.time=l.travelTime,c.length=l.length,c.maneuvers=e.map(l.maneuvers,function(e){return{street:e.streetName,length:e.length,route:e.routeName}}),typeof o.onroute=="function"&&o.onroute.call(this.element,c),h=e.Event("jhere.route",{route:c,target:this.element}),e(this.element).trigger(h)):i==="failed"&&e.error("Failed to calculate route")},u=new t.routing.Manager,u.addObserver("state",e.proxy(f,this)),a=new t.routing.WaypointParameterList,a.addCoordinate(n),a.addCoordinate(s),l={transportModes:[o.transportMode],type:o.type,options:o.options,trafficMode:o.trafficMode},u.calculateRoute(a,[l])},e.jHERE.extend("route",n)})(jQuery);
+(function(e){function i(e){return e instanceof Array?{latitude:e[0],longitude:e[1]}:e}var t,n,r={type:"shortest",transportMode:"car",options:"",trafficMode:"default",width:4,color:"#ff6347",marker:{text:"#",textColor:"#fff"},zoomTo:!0};n=function(n,s,o){var u,a,f,l;t=t||nokia.maps,n=i(n),s=i(s),o=e.extend({},r,o),f=function(n,r,i){var s,u,a,f,l,c={},h;i==="finished"?(s=n.getRoutes(),f=s[0],a=new t.map.Polyline(f&&f.shape,{pen:new t.util.Pen({lineWidth:o.width,strokeColor:o.color})}),u=new t.map.Container,u.objects.add(a),e.each(f.waypoints,e.proxy(function(t,n){var r=e.extend({},o.marker);o.marker.text==="#"&&(r.text=t+1),this.marker(n.originalPosition,r)},this)),this.map.objects.add(u),o.zoomTo&&this.map.zoomTo(u.getBoundingBox(),!1,"default"),l=f.legs&&f.legs.length&&f.legs[0],c.time=l.travelTime,c.length=l.length,c.maneuvers=l.maneuvers,typeof o.onroute=="function"&&o.onroute.call(this.element,c),h=e.Event("jhere.route",{route:c,target:this.element}),e(this.element).trigger(h)):i==="failed"&&e.error("Failed to calculate route")},u=new t.routing.Manager,u.addObserver("state",e.proxy(f,this)),a=new t.routing.WaypointParameterList,a.addCoordinate(n),a.addCoordinate(s),l={transportModes:[o.transportMode],type:o.type,options:o.options,trafficMode:o.trafficMode},u.calculateRoute(a,[l])},e.jHERE.extend("route",n)})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.