text: webpackJsonp([1,2],{157:function(e,t,n){"use strict";function r(e){var t;switch(e){case"ntut":t=o.driversLocation.ntut;break;case"station":t=o.driversLocation.station;break;case"taipei101":t=o.driversLocation.taipei101;break;default:t=o.driversLocation.error}return{type:a,payload:t}}function i(e,t,n,r){var i=new google.maps.DirectionsService;return new Promise(function(o,a){i.route({origin:new google.maps.LatLng(e,t),destination:new google.maps.LatLng(n,r),travelMode:google.maps.TravelMode.DRIVING},function(e,t){t===google.maps.DirectionsStatus.OK?o(e):(console.error("error fetching directions."),a())})}).then(function(e){return{type:u,payload:e}}).catch(function(){console.log("Error Fetch")})}Object.defineProperty(t,"__esModule",{value:!0}),t.FEATCH_DIRECTIONS=t.FEATCH_TAXI_LOCATION=void 0,t.fetchTaxiLocation=r,t.fetchDirecions=i;var o=n(289),a=(n(64),t.FEATCH_TAXI_LOCATION="featch_taxi_location"),u=t.FEATCH_DIRECTIONS="featch_directions"},265:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),s=n(287),f=r(s),d=n(288),p=r(d),v=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={lat:0,lon:0},navigator.geolocation.getCurrentPosition(function(e){n.setState({lat:e.coords.latitude,lon:e.coords.longitude})},function(e){console.log("Your browser doesn't support geolocation.",e)}),n}return a(t,e),u(t,[{key:"render",value:function(){return c.default.createElement("div",null,c.default.createElement("div",null,"lat=",this.state.lat),c.default.createElement("div",null,"lng=",this.state.lon),c.default.createElement("div",null,c.default.createElement(p.default,{lat:this.state.lat,lng:this.state.lon})),c.default.createElement("div",{className:"map"},c.default.createElement(f.default,{lat:this.state.lat,lng:this.state.lon})),"END")}}]),t}(l.Component);t.default=v},266:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(52),o=n(290),a=r(o),u=(0,i.combineReducers)({taxiInfo:a.default,directions:a.default});t.default=u},268:function(e,t,n){var r=n(349);"string"==typeof r&&(r=[[e.i,r,""]]);n(620)(r,{});r.locals&&(e.exports=r.locals)},286:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),s=n(64),f=n(368),d=r(f),p=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,[{key:"getPixelPositionOffset",value:function(e,t){return{x:-(e/2),y:-(t/2)}}},{key:"render",value:function(){return c.default.createElement(s.OverlayView,{position:{lat:this.props.lat,lng:this.props.lng},mapPaneName:s.OverlayView.OVERLAY_MOUSE_TARGET,getPixelPositionOffset:this.getPixelPositionOffset},c.default.createElement("div",null,c.default.createElement("img",{height:"30",width:"30",src:d.default}),c.default.createElement("div",null,"driver")))}}]),t}(l.Component);t.default=p},287:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return{taxiInfo:e.taxiInfo.taxiInfo,route:e.directions.directions}}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),s=r(c),f=n(51),d=n(151),p=r(d),v=n(64),h=n(286),g=r(h),m=(0,v.withGoogleMap)(function(e){return s.default.createElement(v.GoogleMap,{defaultZoom:12,defaultCenter:{lat:e.lat,lng:e.lng}},e.markers,e.directions&&s.default.createElement(v.DirectionsRenderer,{directions:e.directions}))}),y=function(e){function t(){var e,n,r,a;i(this,t);for(var u=arguments.length,l=Array(u),c=0;c<u;c++)l[c]=arguments[c];return n=r=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.state={origin:new google.maps.LatLng(41.85073,-87.65126),destination:new google.maps.LatLng(41.85258,-87.65141),directions:null},a=n,o(r,a)}return a(t,e),l(t,[{key:"renderMarkers",value:function(){return p.default.map(this.props.taxiInfo,function(e){return s.default.createElement(g.default,{key:e.DriverId,lat:e.latitude,lng:e.longitude})})}},{key:"render",value:function(){return console.log("Connect Route:",this.props.route),this.props.lat?s.default.createElement(m,{containerElement:s.default.createElement("div",{style:{height:"100%",width:"100%"}}),mapElement:s.default.createElement("div",{style:{height:"100%",width:"100%"}}),lat:this.props.lat,lng:this.props.lng,markers:this.renderMarkers(),directions:this.props.route?this.props.route:null}):s.default.createElement("div",null,"Loading..")}}]),t}(c.Component);t.default=(0,f.connect)(u)(y)},288:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),s=n(157),f=n(51),d=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onSelectChange=n.onSelectChange.bind(n),n}return a(t,e),u(t,[{key:"onSelectChange",value:function(e){this.props.fetchTaxiLocation(e.target.value);var t,n;switch(e.target.value){case"ntut":t=25.042171,n=121.535507;break;case"station":t=25.04808,n=121.517054;break;case"taipei101":t=25.034234,n=121.56451}this.props.fetchDirecions(this.props.lat,this.props.lng,t,n)}},{key:"render",value:function(){return c.default.createElement("select",{onChange:this.onSelectChange},c.default.createElement("option",{value:"ntut"},"NTUT"),c.default.createElement("option",{value:"station"},"台北車站"),c.default.createElement("option",{value:"taipei101"},"台北101"))}}]),t}(l.Component);t.default=(0,f.connect)(null,{fetchTaxiLocation:s.fetchTaxiLocation,fetchDirecions:s.fetchDirecions})(d)},289:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.driversLocation={ntut:[{id:"1472624542-98-25.0612060437064-121.536598889408",latitude:25.0612060437064,longitude:121.536598889408,DriverId:879595,DriverName:"張偉誠",License:"GX-106"},{id:"1472624726-19-25.0593013639487-121.548908579886",latitude:25.0593013639487,longitude:121.548908579886,DriverId:551404,DriverName:"王彥帆",License:"FF-203"},{id:"1472624635-98-25.0591834864715-121.546946254225",latitude:25.0591834864715,longitude:121.546946254225,DriverId:161411,DriverName:"蔡幼志",License:"QU-797"},{id:"1472624959-7-25.0595791928171-121.546321870815",latitude:25.0595791928171,longitude:121.546321870815,DriverId:506970,DriverName:"黃坤琦",License:"EB-072"},{id:"1472624635-98-25.059183-121.546946",latitude:25.059183,longitude:121.546946,DriverId:504289,DriverName:"羅珈禮",License:"UI-144"},{id:"1472624609-60-25.060063-121.53758",latitude:25.060063,longitude:121.53758,DriverId:547993,DriverName:"郭采劭",License:"UC-621"},{id:"1472624686-10-25.0648798515756-121.541059075204",latitude:25.0648798515756,longitude:121.541059075204,DriverId:846021,DriverName:"吳雅玲",License:"LR-224"},{id:"1472624603-102-25.0627950607745-121.544983894887",latitude:25.0627950607745,longitude:121.544983894887,DriverId:794634,DriverName:"李宗霖",License:"RY-517"},{id:"1472624959-7-25.059579-121.546322",latitude:25.059579,longitude:121.546322,DriverId:263257,DriverName:"陳建如",License:"BJ-591"},{id:"1472624473-118-25.062839-121.537759",latitude:25.062839,longitude:121.537759,DriverId:683298,DriverName:"張志湖",License:"KZ-334"},{id:"1472624437-140-25.0630867450543-121.538115372082",latitude:25.0630867450543,longitude:121.538115372082,DriverId:448473,DriverName:"林宗翰",License:"TP-996"},{id:"1472624609-60-25.0600632763539-121.537580145198",latitude:25.0600632763539,longitude:121.537580145198,DriverId:620989,DriverName:"劉育軍",License:"GF-444"},{id:"1472624423-116-25.059658-121.549387",latitude:25.059658,longitude:121.549387,DriverId:506686,DriverName:"陳俊映",License:"QI-952"}],station:[{id:"1472624422-13-25.060041-121.538026",latitude:25.060041,longitude:121.538026,DriverId:471384,DriverName:"陳淑奇",License:"SM-552"},{id:"1472624542-98-25.061206-121.536599",latitude:25.061206,longitude:121.536599,DriverId:861767,DriverName:"蔣辛堅",License:"BR-752"},{id:"1472624444-29-25.060904-121.553012",latitude:25.060904,longitude:121.553012,DriverId:840591,DriverName:"蔡哲宇",License:"IE-4996"},{id:"1472624686-10-25.06488-121.541059",latitude:25.06488,longitude:121.541059,DriverId:538784,DriverName:"林于禮",License:"AK-199"},{id:"1472624726-19-25.059301-121.548909",latitude:25.059301,longitude:121.548909,DriverId:320193,DriverName:"王俊豪",License:"VI-039"},{id:"1472624442-127-25.0683490993324-121.538293780488",latitude:25.0683490993324,longitude:121.538293780488,DriverId:235962,DriverName:"賴耿為",License:"UY-616"},{id:"1472624444-29-25.0609038128717-121.553011515602",latitude:25.0609038128717,longitude:121.553011515602,DriverId:502932,DriverName:"羅彥志",License:"LZ-801"}],taipei101:[{id:"1472625078-118-25.060593557681-121.546589464123",latitude:25.060593557681,longitude:121.546589464123,DriverId:819434,DriverName:"陳志偉",License:"KF-881"},{id:"1472624603-102-25.062795-121.544984",latitude:25.062795,longitude:121.544984,DriverId:686137,DriverName:"蔣弘亨",License:"YE-129"},{id:"1472624473-118-25.0628392490287-121.537758554437",latitude:25.0628392490287,longitude:121.537758554437,DriverId:128280,DriverName:"顏孟倫",License:"XN-377"},{id:"1472624422-13-25.0600411303816-121.538026167775",latitude:25.0600411303816,longitude:121.538026167775,DriverId:192393,DriverName:"羅宗翰",License:"KT-724"},{id:"1472624437-140-25.063087-121.538115",latitude:25.063087,longitude:121.538115,DriverId:174463,DriverName:"陸平盈",License:"OG-465"},{id:"1472625078-118-25.060594-121.546589",latitude:25.060594,longitude:121.546589,DriverId:868941,DriverName:"張家真",License:"ZH-266"}],success:!0,errors:[]}},290:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];switch(t.type){case i.FEATCH_TAXI_LOCATION:return r({},e,{taxiInfo:t.payload});case i.FEATCH_DIRECTIONS:return r({},e,{directions:t.payload});default:return e}};var i=n(157)},349:function(e,t,n){t=e.exports=n(350)(),t.push([e.i,".map{height:500px;width:100%}",""])},350:function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},368:function(e,t,n){e.exports=n.p+"6845d5a35ca799ecb3a41915aa190c5d.png"},620:function(e,t){function n(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=d[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(l(r.parts[o],t))}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(l(r.parts[o],t));d[r.id]={id:r.id,refs:1,parts:a}}}}function r(e){for(var t=[],n={},r=0;r<e.length;r++){var i=e[r],o=i[0],a=i[1],u=i[2],l=i[3],c={css:a,media:u,sourceMap:l};n[o]?n[o].parts.push(c):t.push(n[o]={id:o,parts:[c]})}return t}function i(e,t){var n=h(),r=y[y.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),y.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function o(e){e.parentNode.removeChild(e);var t=y.indexOf(e);t>=0&&y.splice(t,1)}function a(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function u(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function l(e,t){var n,r,i;if(t.singleton){var l=m++;n=g||(g=a(t)),r=c.bind(null,n,l,!1),i=c.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=f.bind(null,n),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(t),r=s.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function c(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function s(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function f(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([n],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}var d={},p=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},v=p(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),h=p(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,m=0,y=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},"undefined"==typeof t.singleton&&(t.singleton=v()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var i=r(e);return n(i,t),function(e){for(var o=[],a=0;a<i.length;a++){var u=i[a],l=d[u.id];l.refs--,o.push(l)}if(e){var c=r(e);n(c,t)}for(var a=0;a<o.length;a++){var l=o[a];if(0===l.refs){for(var s=0;s<l.parts.length;s++)l.parts[s]();delete d[l.id]}}}};var b=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},624:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(0),o=r(i),a=n(50),u=r(a),l=n(51),c=n(52),s=n(94),f=r(s),d=n(265),p=r(d),v=n(266),h=r(v);n(268);var g=(0,c.applyMiddleware)(f.default)(c.createStore);u.default.render(o.default.createElement(l.Provider,{store:g(h.default)},o.default.createElement(p.default,null)),document.querySelector(".container"))}},[624]);