diff --git a/bower.json b/bower.json index 015aac0..2dd7f84 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "r360", - "version": "0.0.12", + "version": "0.0.13", "authors": [ "gerber@motionintelligence.net", "hollburg@motionintelligence.net" diff --git a/dist/r360-src.js b/dist/r360-src.js index 74d8359..05a0717 100644 --- a/dist/r360-src.js +++ b/dist/r360-src.js @@ -1,5 +1,5 @@ /* - Route360° JavaScript API v0.0.9 (4f9ae63), a JS library for leaflet maps. http://route360.net + Route360° JavaScript API v0.0.9 (8488ac8), a JS library for leaflet maps. http://route360.net (c) 2014 Henning Hollburg and Daniel Gerber, (c) 2014 Motion Intelligence GmbH */ (function (window, document, undefined) { @@ -119,7 +119,7 @@ r360.config = { defaultPlaceAutoCompleteOptions : { serviceUrl : "http://geocode.route360.net/solr/select?", - serviceUrl : "http://148.251.160.52/api?", + // serviceUrl : "http://148.251.160.52/api?", position : 'topleft', reset : false, reverse : false, @@ -142,7 +142,7 @@ r360.config = { backgroundOpacity : 0.5, inverse : false, - animate : true, + animate : false, animationDuration : 1 }, @@ -542,8 +542,8 @@ r360.TravelOptions = function(){ // validate each source _.each(this.getSources(), function(source){ - if ( !_.has(source, 'lat') ) this.getErrors().push('Sources contains source with undefined latitude!'); - if ( !_.has(source, 'lon') ) this.getErrors().push('Sources contains source with undefined longitude!'); + if ( !_.has(source, 'lat') && typeof source.getLatLng !== 'function' ) this.getErrors().push('Sources contains source with undefined latitude!'); + if ( !_.has(source, 'lon') && typeof source.getLatLng !== 'function' ) this.getErrors().push('Sources contains source with undefined longitude!'); }); } } @@ -618,8 +618,8 @@ r360.TravelOptions = function(){ // validate each source _.each(this.getTargets(), function(target){ - if ( !_.has(target, 'lat') ) this.getErrors().push('Targets contains target with undefined latitude!'); - if ( !_.has(target, 'lon') ) this.getErrors().push('Targets contains target with undefined longitude!'); + if ( !_.has(target, 'lat') && typeof target.getLatLng !== 'function' ) this.getErrors().push('Targets contains target with undefined latitude!'); + if ( !_.has(target, 'lon') && typeof target.getLatLng !== 'function' ) this.getErrors().push('Targets contains target with undefined longitude!'); }); } } @@ -3252,7 +3252,7 @@ r360.Route360PolygonLayer = L.Class.extend({ return true; var val = (p1.x * (p2.y -p3.y) + p2.x * (p3.y - p1.y) + p3.x * (p1.y - p2.y)); - if(val < 1 && val > -1) + if(val < 1 && val > -1 && p1.x != p3.x && p1.y != p3.y) return true; return false; }, @@ -3576,7 +3576,7 @@ r360.Route360PolygonLayer = L.Class.extend({ var svgStart = "
"; var gees = ""; diff --git a/dist/r360.js b/dist/r360.js index c946afd..f9ba965 100644 --- a/dist/r360.js +++ b/dist/r360.js @@ -1,6 +1,6 @@ /* - Route360° JavaScript API v0.0.9 (4f9ae63), a JS library for leaflet maps. http://route360.net + Route360° JavaScript API v0.0.9 (8488ac8), a JS library for leaflet maps. http://route360.net (c) 2014 Henning Hollburg and Daniel Gerber, (c) 2014 Motion Intelligence GmbH */ -!function(t){function e(){var e=t.r360;o.noConflict=function(){return t.r360=e,this},t.r360=o}var o={version:"v0.0.9"};"object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd?define(o):e(),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),o=this,i=function(){},n=function(){return o.apply(this instanceof i&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,n.prototype=new i,n}),o.config={serviceUrl:"http://api.route360.net/api_dev/",nominatimUrl:"http://geocode.route360.net/",serviceVersion:"v1",pathSerializer:"compact",maxRoutingTime:3600,bikeSpeed:15,bikeUphill:20,bikeDownhill:-10,walkSpeed:5,walkUphill:10,walkDownhill:0,travelTimes:[300,600,900,1200,1500,1800],travelType:"walk",logging:!1,utm:!0,defaultTravelTimeControlOptions:{travelTimes:[{time:300,color:"#006837",opacity:.1},{time:600,color:"#39B54A"},{time:900,color:"#8CC63F"},{time:1200,color:"#F7931E"},{time:1500,color:"#F15A24"},{time:1800,color:"#C1272D"}],position:"topright",label:"travel time",initValue:30},routeTypes:[{routeType:"WALK",color:"#558D54",halo:"#558D54"},{routeType:"BIKE",color:"#558D54",halo:"#558D54"},{routeType:"CAR",color:"#558D54",halo:"#558D54"},{routeType:"TRANSFER",color:"#558D54",halo:"#558D54"},{routeType:102,color:"#006837",halo:"#006837"},{routeType:400,color:"#156ab8",halo:"#156ab8"},{routeType:900,color:"red",halo:"red"},{routeType:700,color:"#A3007C",halo:"#A3007C"},{routeType:1e3,color:"blue",halo:"blue"},{routeType:109,color:"#006F35",halo:"#006F35"},{routeType:100,color:"red",halo:"red"},{routeType:1,color:"red",halo:"red"},{routeType:2,color:"blue",halo:"blue"},{routeType:3,color:"yellow",halo:"yellow"},{routeType:0,color:"green",halo:"green"},{routeType:4,color:"orange",halo:"orange"},{routeType:5,color:"red",halo:"red"},{routeType:6,color:"blue",halo:"blue"},{routeType:7,color:"yellow",halo:"yellow"}],defaultPlaceAutoCompleteOptions:{serviceUrl:"http://geocode.route360.net/solr/select?",serviceUrl:"http://148.251.160.52/api?",position:"topleft",reset:!1,reverse:!1,placeholder:"Select source",maxRows:5,width:300},defaultRadioOptions:{position:"topright"},defaultPolygonLayerOptions:{opacity:.4,strokeWidth:30,backgroundColor:"black",backgroundOpacity:.5,inverse:!1,animate:!0,animationDuration:1},i18n:{language:"de",departure:{en:"Departure",de:"Abfahrt"},line:{en:"Line",de:"Linie"},arrival:{en:"Arrival",de:"Ankunft"},from:{en:"From",de:"Von"},to:{en:"To",de:"Nach"},travelTime:{en:"Travel time",de:"Reisezeit"},totalTime:{en:"Total time",de:"Gesamtzeit"},distance:{en:"Distance",de:"Distanz"},wait:{en:"Please wait!",de:"Bitte warten!"},elevation:{en:"Elevation",de:"Höhenunterschied"},timeFormat:{en:"a.m.",de:"Uhr"},reset:{en:"Reset input",de:"Eingeben löschen"},reverse:{en:"Switch source and target",de:"Start und Ziel tauschen"},noRouteFound:{en:"No route found!",de:"Keine Route gefunden!"},monthNames:{de:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},dayNames:{de:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},dayNamesMin:{de:["So","Mo","Di","Mi","Do","Fr","Sa"]},get:function(t){var e;return _.each(_.keys(o.config.i18n),function(i){t==i&&(e=o.config.i18n[t][o.config.i18n.language])}),e}}},o.Util={getTimeInSeconds:function(){var t=new Date;return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()},getHoursAndMinutesInSeconds:function(){var t=new Date;return 3600*t.getHours()+60*t.getMinutes()},getCurrentDate:function(){var t=new Date,e=t.getFullYear(),o=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,i=t.getDate()<10?"0"+t.getDate():t.getDate();return e+""+o+i},getTimeFormat:function(t){var e=o.config.i18n;return"en"==e.language&&t>=43200?"p.m.":e.get("timeFormat")},secondsToHoursAndMinutes:function(t){var e=(t/60).toFixed(0),o=Math.floor(e/60);e-=60*o;var i="";return 0!=o&&(i+=o+"h "),i+=e+"min"},secondsToTimeOfDay:function(t){var e=Math.floor(t/3600),o=Math.floor(t/60)-60*e;return t=t-3600*e-60*o,e+":"+("0"+o).slice(-2)+":"+("0"+t).slice(-2)},generateId:function(t){var e="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return _.each(_.range(t?t:10),function(){e+=o.charAt(Math.floor(Math.random()*o.length))}),e},parseLatLonArray:function(t){for(var e=new Array,o=0;o