p&&(p=h(b,p));p=Math.max(Math.min(parseFloat(p.toFixed(7)),100),0);if(p===x[g])return 1===l.length?!1:p===H||p===k?0:!1;d.css(b.style,p+"%");d.is(":first-child")&&d.toggleClass(f[17],50d&&(e+=Math.abs(d)),100= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing;function program1(depth0,data){var buffer="",stack1;buffer+="\n ';stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.programWithDepth(4,program4,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=helpers["if"].call(depth0,depth0&&depth0.label,{hash:{},inverse:self.noop,fn:self.programWithDepth(6,program6,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program2(depth0,data,depth1){var buffer="",stack1;buffer+='href="'+escapeExpression((stack1=depth1&&depth1.url,typeof stack1===functionType?stack1.apply(depth0):stack1))+'"';return buffer}function program4(depth0,data,depth1){var buffer="",stack1;buffer+=' ';return buffer}function program6(depth0,data,depth1){var buffer="",stack1;buffer+=" "+escapeExpression((stack1=depth1&&depth1.label,typeof stack1===functionType?stack1.apply(depth0):stack1));return buffer}buffer+="\n";options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data};if(helper=helpers.buttons){stack1=helper.call(depth0,options)}else{helper=depth0&&depth0.buttons;stack1=typeof helper===functionType?helper.call(depth0,options):helper}if(!helpers.buttons){stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data})}if(stack1||stack1===0){buffer+=stack1}buffer+="\n ";return buffer});templates["circle-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\n Add Circle \n"}function program3(depth0,data){return"\n Edit Circle \n"}function program5(depth0,data,depth1){var buffer="",stack1;buffer+='\n \n
\n
\n Address '+escapeExpression((stack1=depth1&&depth1.address,typeof stack1===functionType?stack1.apply(depth0):stack1))+' Change Location \n
\n
\n Latitude '+escapeExpression((stack1=depth1&&depth1.lat,typeof stack1===functionType?stack1.apply(depth0):stack1))+' \n
\n Longitude '+escapeExpression((stack1=depth1&&depth1.lng,typeof stack1===functionType?stack1.apply(depth0):stack1))+'\n
\n
\n
\n Radius \n \n
\n
\n Metric \n \n Feet \n Miles \n Metres \n Kilometres \n \n
\n
\n ';return buffer}function program7(depth0,data){return'\n + Set Location \n '}function program9(depth0,data){return'\n Save Circle \n '}function program11(depth0,data){return'\n Save Changes \n '}buffer+='\n
\n\n';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n
\n \n \n\n
\n \n ';stack1=helpers["if"].call(depth0,depth0&&depth0.lat,{hash:{},inverse:self.noop,fn:self.programWithDepth(5,program5,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},helper?helper.call(depth0,depth0&&depth0.lat,options):helperMissing.call(depth0,"not",depth0&&depth0.lat,options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n
\n\n
\n\n
\n\n
\n
\n
\n Stroke Color \n \n
\n
\n
\n
\n\n
\n
\n
\n
Stroke Opacity \n
\n
\n
\n
\n
\n
\n\n
\n\n
\n\n
\n ';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n Cancel \n \n\n
\n\n
';return buffer});templates["delete-circle-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Circle? \n\nAre you sure you want to delete this circle?
\n\n'});templates["delete-marker-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Marker? \n\nAre you sure you want to delete this marker?
\n\n'});templates["delete-polygon-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Polygon? \n\nAre you sure you want to delete this polygon?
\n\n'});templates["delete-polyline-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Polyline? \n\nAre you sure you want to delete this polyline?
\n\n'});templates["delete-route-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Route? \n\nAre you sure you want to delete this route?
\n\n'});templates["edit-marker-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,functionType="function",escapeExpression=this.escapeExpression;buffer+='Edit Marker \n\nTitle \n \n\nContent \n\n\n';return buffer});templates["geocoder"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,functionType="function",escapeExpression=this.escapeExpression,self=this;function program1(depth0,data,depth1){var buffer="",stack1;buffer+='\nLocations Found \n\n\n';stack1=helpers.each.call(depth0,depth1&&depth1.locations,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n";return buffer}function program2(depth0,data){var buffer="",stack1;buffer+='\n '+escapeExpression((stack1=depth0&&depth0.formatted_address,typeof stack1===functionType?stack1.apply(depth0):stack1))+" \n";return buffer}buffer+='Find a Location \n\n \n\n';stack1=helpers["if"].call(depth0,depth0&&depth0.locations,{hash:{},inverse:self.noop,fn:self.programWithDepth(1,program1,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n';return buffer});templates["map-list"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,self=this,functionType="function",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\nThere are no markers on the map.
\n"}function program3(depth0,data){var buffer="",stack1,helper,options;buffer+="\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data});
+var opts=$.extend(defaults,options);return this.each(function(){var txt=$(this),$color=$('
');txt.wrap('
');txt.parent().append($color);var colorsMarkup="";var prefix=txt.attr("id").replace(/-/g,"")+"_";for(var i=0;i0&&breakLine&&$.browser&&$.browser.msie&&$.browser.version<=7){breakLine="";colorsMarkup+=' '}colorsMarkup+=' '}var box=$('');var isDown=false;box.insertAfter(txt);box.hide();box.find("li.color-box").on("mouseup",function(){isDown=false;$(this).click()});box.find("li.color-box").on("mousedown",function(){isDown=true});box.find("li.color-box").click(function(){if(txt.is("input")){txt.val(opts.colors[this.id.substr(this.id.indexOf("-")+1)]);txt.blur()}if($.isFunction(defaults.onChangeColor)){defaults.onChangeColor.call(txt,opts.colors[this.id.substr(this.id.indexOf("-")+1)])}hideBox(box)});$("body").on("click",function(){hideBox(box)});$color.click(function(){setTimeout(function(){showBox(box)},10)});txt.on("blur",function(){setTimeout(function(){if(!isDown){hideBox(box)}},100)});box.click(function(event){event.stopPropagation()});var positionAndShowBox=function(box){showBox(box)};txt.click(function(event){event.stopPropagation();if(!txt.is("input")){positionAndShowBox(box)}});txt.focus(function(){positionAndShowBox(box)});function hideBox(box){if(opts.hideEffect=="fade")box.fadeOut();else if(opts.hideEffect=="slide")box.slideUp();else box.hide();updateColor()}function updateColor(){$color.css("background-color",txt.val())}function showBox(box){if(opts.showEffect=="fade")box.fadeIn();else if(opts.showEffect=="slide")box.slideDown();else box.show()}updateColor()})};(function(c){function m(a,c,d){if((a[c]||a[d])&&a[c]===a[d])throw Error("(Link) '"+c+"' can't match '"+d+"'.'")}function r(a){void 0===a&&(a={});if("object"!==typeof a)throw Error("(Format) 'format' option must be an object.");var h={};c(u).each(function(c,n){if(void 0===a[n])h[n]=A[c];else if(typeof a[n]===typeof A[c]){if("decimals"===n&&(0>a[n]||7a&&(n=this.a("negative"),k=this.a("negativeBefore"));a=Math.abs(a).toFixed(d).toString();a=a.split(".");this.a("thousand")?(m=c(a[0]).match(/.{1,3}/g),m=c(m.join(c(this.a("thousand"))))):m=a[0];this.a("mark")&&1 ")[0]};k.prototype.H=function(a){this.method="val";this.j=document.createElement("input");this.j.name=a;this.j.type="hidden"};k.prototype.G=function(a){function h(a,c){return[c?null:a,c?a:null]}var d=this;this.method="val";this.target=a.on("change",function(a){d.B.val(h(c(a.target).val(),d.t),{link:d,set:!0})})};k.prototype.p=function(a,h,d,k){this.g=d;this.update=!k;if("string"===typeof a&&0===a.indexOf("-tooltip-"))this.K(a,h);else if("string"===typeof a&&0!==a.indexOf("-"))this.H(a);else if("function"===typeof a)this.target=!1,this.method=a;else{if(a instanceof c||c.zepto&&c.zepto.isZ(a)){if(!h){if(a.is("input, select, textarea")){this.G(a);return}h="html"}if("function"===typeof h||"string"===typeof h&&a[h]){this.method=h;this.target=a;return}}throw new RangeError("(Link) Invalid Link.")}};k.prototype.write=function(a,c,d,k){if(!this.update||!1!==k)if(this.u=a,this.F=a=this.format(a),"function"===typeof this.method)this.method.call(this.target[0]||d[0],a,c,d);else this.target[this.method](a,c,d)};k.prototype.q=function(a){this.g=new r(c.extend({},a,this.g instanceof r?this.g.r:this.g))};k.prototype.J=function(a){this.B=a};k.prototype.I=function(a){this.t=a};k.prototype.format=function(a){return this.g.L(a)};k.prototype.A=function(a){return this.g.w(a)};k.prototype.p.prototype=k.prototype;c.Link=k})(window.jQuery||window.Zepto);(function(c){function m(e){return"number"===typeof e&&!isNaN(e)&&isFinite(e)}function r(e){return c.isArray(e)?e:[e]}function k(e,b){e.addClass(b);setTimeout(function(){e.removeClass(b)},300)}function u(e,b){return 100*b/(e[1]-e[0])}function A(e,b){if(b>=e.d.slice(-1)[0])return 100;for(var a=1,c,f,d;b>=e.d[a];)a++;c=e.d[a-1];f=e.d[a];d=e.c[a-1];c=[c,f];return d+u(c,0>c[0]?b+Math.abs(c[0]):b-c[0])/(100/(e.c[a]-d))}function a(e,b){if(100<=b)return e.d.slice(-1)[0];for(var a=1,c,f,d;b>=e.c[a];)a++;c=e.d[a-1];f=e.d[a];d=e.c[a-1];c=[c,f];return 100/(e.c[a]-d)*(b-d)*(c[1]-c[0])/100+c[0]}function h(a,b){for(var c=1,g;(a.dir?100-b:b)>=a.c[c];)c++;if(a.m)return g=a.c[c-1],c=a.c[c],b-g>(c-g)/2?c:g;a.h[c-1]?(g=a.h[c-1],c=a.c[c-1]+Math.round((b-a.c[c-1])/g)*g):c=b;return c}function d(a,b){if(!m(b))throw Error("noUiSlider: 'step' is not numeric.");a.h[0]=b}function n(a,b){if("object"!==typeof b||c.isArray(b))throw Error("noUiSlider: 'range' is not an object.");if(void 0===b.min||void 0===b.max)throw Error("noUiSlider: Missing 'min' or 'max' in 'range'.");c.each(b,function(b,g){var d;"number"===typeof g&&(g=[g]);if(!c.isArray(g))throw Error("noUiSlider: 'range' contains invalid value.");d="min"===b?0:"max"===b?100:parseFloat(b);if(!m(d)||!m(g[0]))throw Error("noUiSlider: 'range' value isn't numeric.");a.c.push(d);a.d.push(g[0]);d?a.h.push(isNaN(g[1])?!1:g[1]):isNaN(g[1])||(a.h[0]=g[1])});c.each(a.h,function(b,c){if(!c)return!0;a.h[b]=u([a.d[b],a.d[b+1]],c)/(100/(a.c[b+1]-a.c[b]))})}function E(a,b){"number"===typeof b&&(b=[b]);if(!c.isArray(b)||!b.length||2
").addClass(f[2]),g=["-lower","-upper"];a.dir&&g.reverse();d.children().addClass(f[3]+" "+f[3]+g[b]);return d}function Q(a,b){b.j&&(b=new c.Link({target:c(b.j).clone().appendTo(a),method:b.method,format:b.g},!0));return b}function R(a,b){var d,f=[];for(d=0;d ").appendTo(b).addClass(f[1])}function V(d,b,m){function g(){return t[["width","height"][b.k]]()}function n(a){var b,c=[q.val()];for(b=0;bp&&(p=h(b,p));p=Math.max(Math.min(parseFloat(p.toFixed(7)),100),0);if(p===x[g])return 1===l.length?!1:p===H||p===k?0:!1;d.css(b.style,p+"%");d.is(":first-child")&&d.toggleClass(f[17],50d&&(e+=Math.abs(d)),100= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,blockHelperMissing=helpers.blockHelperMissing;function program1(depth0,data){var buffer="",stack1;buffer+="\n ';stack1=helpers["if"].call(depth0,depth0&&depth0.icon,{hash:{},inverse:self.noop,fn:self.programWithDepth(4,program4,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=helpers["if"].call(depth0,depth0&&depth0.label,{hash:{},inverse:self.noop,fn:self.programWithDepth(6,program6,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program2(depth0,data,depth1){var buffer="",stack1;buffer+='href="'+escapeExpression((stack1=depth1&&depth1.url,typeof stack1===functionType?stack1.apply(depth0):stack1))+'"';return buffer}function program4(depth0,data,depth1){var buffer="",stack1;buffer+=' ';return buffer}function program6(depth0,data,depth1){var buffer="",stack1;buffer+=" "+escapeExpression((stack1=depth1&&depth1.label,typeof stack1===functionType?stack1.apply(depth0):stack1));return buffer}buffer+="\n";options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data};if(helper=helpers.buttons){stack1=helper.call(depth0,options)}else{helper=depth0&&depth0.buttons;stack1=typeof helper===functionType?helper.call(depth0,options):helper}if(!helpers.buttons){stack1=blockHelperMissing.call(depth0,stack1,{hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data})}if(stack1||stack1===0){buffer+=stack1}buffer+="\n ";return buffer});templates["circle-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\n Add Circle \n"}function program3(depth0,data){return"\n Edit Circle \n"}function program5(depth0,data,depth1){var buffer="",stack1;buffer+='\n \n
\n
\n Address '+escapeExpression((stack1=depth1&&depth1.address,typeof stack1===functionType?stack1.apply(depth0):stack1))+' Change Location \n
\n
\n Latitude '+escapeExpression((stack1=depth1&&depth1.lat,typeof stack1===functionType?stack1.apply(depth0):stack1))+' \n
\n Longitude '+escapeExpression((stack1=depth1&&depth1.lng,typeof stack1===functionType?stack1.apply(depth0):stack1))+'\n
\n
\n
\n Radius \n \n
\n
\n
Metric \n\n
\n \n Feet \n Miles \n Metres \n Kilometres \n \n
\n
\n
\n ';return buffer}function program7(depth0,data){return'\n + Set Location \n '}function program9(depth0,data){return'\n Save Circle \n '}function program11(depth0,data){return'\n Save Changes \n '}buffer+='\n
\n\n';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n
\n \n \n\n
\n \n ';stack1=helpers["if"].call(depth0,depth0&&depth0.lat,{hash:{},inverse:self.noop,fn:self.programWithDepth(5,program5,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},helper?helper.call(depth0,depth0&&depth0.lat,options):helperMissing.call(depth0,"not",depth0&&depth0.lat,options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n
\n\n
\n\n
\n\n
\n
\n
\n Stroke Color \n \n
\n
\n
\n
\n\n
\n
\n
\n
Stroke Opacity \n
\n
\n
\n
\n
\n
\n\n
\n\n
\n\n
\n ';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n Cancel \n \n\n
\n\n
';return buffer});templates["delete-circle-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Circle? \n\nAre you sure you want to delete this circle?
\n\n'});templates["delete-marker-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Marker? \n\nAre you sure you want to delete this marker?
\n\n'});templates["delete-polygon-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Polygon? \n\nAre you sure you want to delete this polygon?
\n\n'});templates["delete-polyline-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Polyline? \n\nAre you sure you want to delete this polyline?
\n\n'});templates["delete-route-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};return'Delete Route? \n\nAre you sure you want to delete this route?
\n\n'});templates["edit-marker-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,functionType="function",escapeExpression=this.escapeExpression;buffer+='Edit Marker \n\nTitle \n \n\nContent \n\n\n';return buffer});templates["geocoder"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,functionType="function",escapeExpression=this.escapeExpression,self=this;function program1(depth0,data,depth1){var buffer="",stack1;buffer+='\nLocations Found \n\n\n';stack1=helpers.each.call(depth0,depth1&&depth1.locations,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n";return buffer}function program2(depth0,data){var buffer="",stack1;buffer+='\n '+escapeExpression((stack1=depth0&&depth0.formatted_address,typeof stack1===functionType?stack1.apply(depth0):stack1))+" \n";return buffer}buffer+='Find a Location \n\n \n\n';stack1=helpers["if"].call(depth0,depth0&&depth0.locations,{hash:{},inverse:self.noop,fn:self.programWithDepth(1,program1,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n';return buffer});templates["map-list"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,self=this,functionType="function",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\nThere are no markers on the map.
\n"}function program3(depth0,data){var buffer="",stack1,helper,options;buffer+="\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data});
if(stack1||stack1===0){buffer+=stack1}buffer+=''+escapeExpression((stack1=depth0&&depth0.address,typeof stack1===functionType?stack1.apply(depth0):stack1))+" ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(6,program6,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(8,program8,data),data:data},helper?helper.call(depth0,depth0&&depth0.deleted,options):helperMissing.call(depth0,"not",depth0&&depth0.deleted,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program4(depth0,data){return''}function program6(depth0,data){return' Undo Delete '}function program8(depth0,data){return' '}function program10(depth0,data){return"\nThere are no routes on the map.
\n"}function program12(depth0,data){var buffer="",stack1,helper,options;buffer+="\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='';stack1=helpers["if"].call(depth0,depth0&&depth0.title,{hash:{},inverse:self.noop,fn:self.programWithDepth(13,program13,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.programWithDepth(15,program15,data,depth0),data:data},helper?helper.call(depth0,depth0&&depth0.title,options):helperMissing.call(depth0,"not",depth0&&depth0.title,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(17,program17,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(19,program19,data),data:data},helper?helper.call(depth0,depth0&&depth0.deleted,options):helperMissing.call(depth0,"not",depth0&&depth0.deleted,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program13(depth0,data,depth1){var stack1;return escapeExpression((stack1=depth1&&depth1.title,typeof stack1===functionType?stack1.apply(depth0):stack1))}function program15(depth0,data,depth1){var buffer="",stack1;buffer+="Route "+escapeExpression((stack1=depth1&&depth1.count,typeof stack1===functionType?stack1.apply(depth0):stack1));return buffer}function program17(depth0,data){return' Undo Delete '}function program19(depth0,data){return' '}function program21(depth0,data){return"\nThere are no polygons on the map.
\n"}function program23(depth0,data){var buffer="",stack1,helper,options;buffer+="\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='';stack1=helpers["if"].call(depth0,depth0&&depth0.title,{hash:{},inverse:self.noop,fn:self.programWithDepth(13,program13,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.programWithDepth(24,program24,data,depth0),data:data},helper?helper.call(depth0,depth0&&depth0.title,options):helperMissing.call(depth0,"not",depth0&&depth0.title,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(26,program26,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(28,program28,data),data:data},helper?helper.call(depth0,depth0&&depth0.deleted,options):helperMissing.call(depth0,"not",depth0&&depth0.deleted,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program24(depth0,data,depth1){var buffer="",stack1;buffer+="Polygon "+escapeExpression((stack1=depth1&&depth1.count,typeof stack1===functionType?stack1.apply(depth0):stack1));return buffer}function program26(depth0,data){return' Undo Delete '}function program28(depth0,data){return' '}function program30(depth0,data){return"\nThere are no polylines on the map.
\n"}function program32(depth0,data){var buffer="",stack1,helper,options;buffer+="\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='';stack1=helpers["if"].call(depth0,depth0&&depth0.title,{hash:{},inverse:self.noop,fn:self.programWithDepth(13,program13,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.programWithDepth(33,program33,data,depth0),data:data},helper?helper.call(depth0,depth0&&depth0.title,options):helperMissing.call(depth0,"not",depth0&&depth0.title,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(35,program35,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(37,program37,data),data:data},helper?helper.call(depth0,depth0&&depth0.deleted,options):helperMissing.call(depth0,"not",depth0&&depth0.deleted,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program33(depth0,data,depth1){var buffer="",stack1;buffer+="Polyline "+escapeExpression((stack1=depth1&&depth1.count,typeof stack1===functionType?stack1.apply(depth0):stack1));return buffer}function program35(depth0,data){return' Undo Delete '}function program37(depth0,data){return' '}function program39(depth0,data){return"\nThere are no circles on the map.
\n"}function program41(depth0,data){var buffer="",stack1,helper,options;buffer+="\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(4,program4,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='';stack1=helpers["if"].call(depth0,depth0&&depth0.title,{hash:{},inverse:self.noop,fn:self.programWithDepth(13,program13,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.programWithDepth(42,program42,data,depth0),data:data},helper?helper.call(depth0,depth0&&depth0.title,options):helperMissing.call(depth0,"not",depth0&&depth0.title,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" ";stack1=helpers["if"].call(depth0,depth0&&depth0.deleted,{hash:{},inverse:self.noop,fn:self.program(44,program44,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(46,program46,data),data:data},helper?helper.call(depth0,depth0&&depth0.deleted,options):helperMissing.call(depth0,"not",depth0&&depth0.deleted,options));if(stack1||stack1===0){buffer+=stack1}buffer+=" \n";return buffer}function program42(depth0,data,depth1){var buffer="",stack1;buffer+="Circle "+escapeExpression((stack1=depth1&&depth1.count,typeof stack1===functionType?stack1.apply(depth0):stack1));return buffer}function program44(depth0,data){return' Undo Delete '}function program46(depth0,data){return' '}buffer+='Markers \n\n× close \n\n';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.markers,stack1==null||stack1===false?stack1:stack1.length),options):helperMissing.call(depth0,"not",(stack1=depth0&&depth0.markers,stack1==null||stack1===false?stack1:stack1.length),options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n';stack1=helpers.each.call(depth0,depth0&&depth0.markers,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n\nRoutes \n\n× close \n\n';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.routes,stack1==null||stack1===false?stack1:stack1.length),options):helperMissing.call(depth0,"not",(stack1=depth0&&depth0.routes,stack1==null||stack1===false?stack1:stack1.length),options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n';stack1=(helper=helpers.forEach||depth0&&depth0.forEach,options={hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data},helper?helper.call(depth0,depth0&&depth0.routes,options):helperMissing.call(depth0,"forEach",depth0&&depth0.routes,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n\nPolygons \n\n";stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(21,program21,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.polygons,stack1==null||stack1===false?stack1:stack1.length),options):helperMissing.call(depth0,"not",(stack1=depth0&&depth0.polygons,stack1==null||stack1===false?stack1:stack1.length),options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n';stack1=(helper=helpers.forEach||depth0&&depth0.forEach,options={hash:{},inverse:self.noop,fn:self.program(23,program23,data),data:data},helper?helper.call(depth0,depth0&&depth0.polygons,options):helperMissing.call(depth0,"forEach",depth0&&depth0.polygons,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n\nPolylines \n\n";stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(30,program30,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.polylines,stack1==null||stack1===false?stack1:stack1.length),options):helperMissing.call(depth0,"not",(stack1=depth0&&depth0.polylines,stack1==null||stack1===false?stack1:stack1.length),options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n';stack1=(helper=helpers.forEach||depth0&&depth0.forEach,options={hash:{},inverse:self.noop,fn:self.program(32,program32,data),data:data},helper?helper.call(depth0,depth0&&depth0.polylines,options):helperMissing.call(depth0,"forEach",depth0&&depth0.polylines,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n\nCircles \n\n";stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(39,program39,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.circles,stack1==null||stack1===false?stack1:stack1.length),options):helperMissing.call(depth0,"not",(stack1=depth0&&depth0.circles,stack1==null||stack1===false?stack1:stack1.length),options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n';stack1=(helper=helpers.forEach||depth0&&depth0.forEach,options={hash:{},inverse:self.noop,fn:self.program(41,program41,data),data:data},helper?helper.call(depth0,depth0&&depth0.circles,options):helperMissing.call(depth0,"forEach",depth0&&depth0.circles,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n ";return buffer});templates["map"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,functionType="function",escapeExpression=this.escapeExpression;buffer+='
\n\n
\n\n\n\n
\n\n';return buffer});templates["marker-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\n Add Marker \n"}function program3(depth0,data){return"\n Edit Marker \n"}function program5(depth0,data,depth1){var stack1;return escapeExpression((stack1=depth1&&depth1.icon,typeof stack1===functionType?stack1.apply(depth0):stack1))}function program7(depth0,data){return"http://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-poi.png&scale=2"}function program9(depth0,data){return'\n Save Marker \n '}function program11(depth0,data){return'\n Save Changes \n '}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n \n \n\n\n\n
\n
\n
Address: ';if(helper=helpers.address){stack1=helper.call(depth0,{hash:{},data:data})}else{helper=depth0&&depth0.address;stack1=typeof helper===functionType?helper.call(depth0,{hash:{},data:data}):helper}buffer+=escapeExpression(stack1)+'
\n
Latitude: ';if(helper=helpers.lat){stack1=helper.call(depth0,{hash:{},data:data})}else{helper=depth0&&depth0.lat;stack1=typeof helper===functionType?helper.call(depth0,{hash:{},data:data}):helper}buffer+=escapeExpression(stack1)+'
\n
Longitude: ';if(helper=helpers.lng){stack1=helper.call(depth0,{hash:{},data:data})}else{helper=depth0&&depth0.lng;stack1=typeof helper===functionType?helper.call(depth0,{hash:{},data:data}):helper}buffer+=escapeExpression(stack1)+'
\n\n
Change Location \n
\n
\n
\n\n
\n\n\n\n\n\n
\n
\n
\n Stroke Color \n \n
\n
\n
\n
\n\n
\n
\n
\n
Stroke Opacity \n
\n
\n
\n
\n
\n
\n\n
\n\n
\n\n\n ';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(9,program9,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n Cancel \n ';return buffer});templates["polygon-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\n Add Polygon \n"}function program3(depth0,data){return"\n Edit Polygon \n"}function program5(depth0,data){return"Show Details"}function program7(depth0,data){return"Hide Details"}function program9(depth0,data){return'style="display:none"'}function program11(depth0,data){var buffer="",stack1,helper;buffer+='\n \n
Point ';if(helper=helpers.count){stack1=helper.call(depth0,{hash:{},data:data})}else{helper=depth0&&depth0.count;stack1=typeof helper===functionType?helper.call(depth0,{hash:{},data:data}):helper}buffer+=escapeExpression(stack1)+' \n
× \n
\n ';return buffer}function program13(depth0,data){return'\n Save Polygon \n '}function program15(depth0,data){return'\n Save Changes \n '}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n \n \n\n\n
';stack1=helpers["if"].call(depth0,depth0&&depth0.hideDetails,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},helper?helper.call(depth0,depth0&&depth0.hideDetails,options):helperMissing.call(depth0,"not",depth0&&depth0.hideDetails,options));if(stack1||stack1===0){buffer+=stack1}buffer+='
\n\n
\n
To add points to the polygon, you can either double click the map or add enter coordinates or addresses manually.
\n\n
\n ';stack1=(helper=helpers.forEach||depth0&&depth0.forEach,options={hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data},helper?helper.call(depth0,depth0&&depth0.points,options):helperMissing.call(depth0,"forEach",depth0&&depth0.points,options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n
\n
\n\n
\n\n
\n\n\n\n\n\n
\n
\n
\n Stroke Color \n \n
\n
\n
\n
\n\n
\n
\n
\n
Stroke Opacity \n
\n
\n
\n
\n
\n
\n\n
\n\n
\n\n\n ';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(15,program15,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n Cancel \n ';return buffer});templates["polyline-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\n Add Polyline \n"}function program3(depth0,data){return"\n Edit Polyline \n"}function program5(depth0,data){return"Show Details"}function program7(depth0,data){return"Hide Details"}function program9(depth0,data){return'style="display:none"'}function program11(depth0,data){var buffer="",stack1,helper;buffer+='\n \n
Point ';if(helper=helpers.count){stack1=helper.call(depth0,{hash:{},data:data})}else{helper=depth0&&depth0.count;stack1=typeof helper===functionType?helper.call(depth0,{hash:{},data:data}):helper}buffer+=escapeExpression(stack1)+' \n
× \n
\n ';return buffer}function program13(depth0,data){return'\n Save Polyline \n '}function program15(depth0,data){return'\n Save Changes \n '}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n \n \n\n\n
';stack1=helpers["if"].call(depth0,depth0&&depth0.hideDetails,{hash:{},inverse:self.noop,fn:self.program(5,program5,data),data:data});if(stack1||stack1===0){buffer+=stack1}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(7,program7,data),data:data},helper?helper.call(depth0,depth0&&depth0.hideDetails,options):helperMissing.call(depth0,"not",depth0&&depth0.hideDetails,options));if(stack1||stack1===0){buffer+=stack1}buffer+='
\n\n
\n
To add points to the polygon, you can either double click the map or add enter coordinates or addresses manually.
\n\n
\n ';stack1=(helper=helpers.forEach||depth0&&depth0.forEach,options={hash:{},inverse:self.noop,fn:self.program(11,program11,data),data:data},helper?helper.call(depth0,depth0&&depth0.points,options):helperMissing.call(depth0,"forEach",depth0&&depth0.points,options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n
\n
\n\n
\n\n
\n\n\n\n\n\n
\n
\n
\n Stroke Color \n \n
\n
\n
\n
\n
Stroke Opacity \n
\n
\n
\n
\n
\n
\n\n
\n\n\n ';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(13,program13,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(15,program15,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n Cancel \n ';return buffer});templates["route-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,functionType="function",escapeExpression=this.escapeExpression,self=this,helperMissing=helpers.helperMissing;function program1(depth0,data){return"\n Add Route \n"}function program3(depth0,data){return"\n Edit Route \n"}function program5(depth0,data){return"Show Details"}function program7(depth0,data){return"Hide Details"}function program9(depth0,data,depth1){var buffer="",stack1,helper,options;buffer+='\n \n ';stack1=(helper=helpers.forEach||depth1&&depth1.forEach,options={hash:{},inverse:self.noop,fn:self.program(10,program10,data),data:data},helper?helper.call(depth0,depth1&&depth1.locations,options):helperMissing.call(depth0,"forEach",depth1&&depth1.locations,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n ";return buffer}function program10(depth0,data){var buffer="",stack1,helper;buffer+='\n \n \n \n ';if(helper=helpers.address){stack1=helper.call(depth0,{hash:{},data:data})}else{helper=depth0&&depth0.address;stack1=typeof helper===functionType?helper.call(depth0,{hash:{},data:data}):helper}buffer+=escapeExpression(stack1)+' \n \n \n \n \n ';return buffer}function program12(depth0,data){return'\n \n '}function program14(depth0,data){return'style="display:none"'}function program16(depth0,data){return'checked="checked"'}function program18(depth0,data){return"on"}function program20(depth0,data){return'\n Save Route \n '}function program22(depth0,data){return'\n Save Changes \n '}stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(1,program1,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(3,program3,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n\n \n \n\n\n \n \n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.locations,{hash:{},inverse:self.noop,fn:self.programWithDepth(9,program9,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(12,program12,data),data:data},helper?helper.call(depth0,(stack1=depth0&&depth0.locations,stack1==null||stack1===false?stack1:stack1.length),options):helperMissing.call(depth0,"not",(stack1=depth0&&depth0.locations,stack1==null||stack1===false?stack1:stack1.length),options));if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n \n\n
+ Add Location \n\n
\n\n\n\n\n\n\n ';stack1=(helper=helpers.not||depth0&&depth0.not,options={hash:{},inverse:self.noop,fn:self.program(20,program20,data),data:data},helper?helper.call(depth0,depth0&&depth0.isSavedToMap,options):helperMissing.call(depth0,"not",depth0&&depth0.isSavedToMap,options));if(stack1||stack1===0){buffer+=stack1}buffer+="\n\n ";stack1=helpers["if"].call(depth0,depth0&&depth0.isSavedToMap,{hash:{},inverse:self.noop,fn:self.program(22,program22,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n \n Cancel \n ';return buffer});templates["route-location-form"]=template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Handlebars.helpers);data=data||{};var buffer="",stack1,helper,functionType="function",escapeExpression=this.escapeExpression,self=this;function program1(depth0,data,depth1){var buffer="",stack1;buffer+='\nLocations Found \n\n\n';stack1=helpers.each.call(depth0,depth1&&depth1.locations,{hash:{},inverse:self.noop,fn:self.program(2,program2,data),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+="\n \n";return buffer}function program2(depth0,data){var buffer="",stack1;buffer+='\n '+escapeExpression((stack1=depth0&&depth0.formatted_address,typeof stack1===functionType?stack1.apply(depth0):stack1))+" \n";return buffer}buffer+='Add Location \n\n \n\n';stack1=helpers["if"].call(depth0,depth0&&depth0.locations,{hash:{},inverse:self.noop,fn:self.programWithDepth(1,program1,data,depth0),data:data});if(stack1||stack1===0){buffer+=stack1}buffer+='\n\n';return buffer})})();var GoogleMaps={Views:{},Models:{}};(function(){"use strict";Backbone.Marionette.TemplateCache.prototype.compileTemplate=function(rawTemplate){return Handlebars.compile(rawTemplate)};GoogleMaps.Template=function(name){var template;if(Handlebars.templates[name]){return Handlebars.templates[name]}else{return false}};GoogleMaps.addScript=function(url,callback){if(typeof google==="undefined"){var script=document.createElement("script");if(callback)script.onload=callback;script.type="text/javascript";script.src=url;document.body.appendChild(script)}else{GoogleMaps.googleApiCallback()}};GoogleMaps.Fieldtype=function($el,options){var App=new Backbone.Marionette.Application;App.options=options;App.addRegions({content:$el});var coord=options.center.split(",");App.addInitializer(function(){var map=new GoogleMaps.Views.Map({fieldname:options.fieldname,savedData:options.savedData,width:options.width,height:options.height,mapOptions:{center:new google.maps.LatLng(parseFloat(coord[0]),parseFloat(coord[1])),zoom:options.zoom},showButtons:options.showButtons,addressFields:options.addressFields});setTimeout(function(){map.redraw();map.updateHiddenField()},100);App.content.show(map)});App.start()}})();(function(){"use strict";GoogleMaps.Models.Base=Backbone.Model.extend({initialize:function(options){var t=this;_.each(options,function(option,i){if(_.isFunction(option)){t[i]=option}});this.set(options)},toJSON:function(){var json=Backbone.Model.prototype.toJSON.call(this);delete json.api;delete json.map;delete json.infowindow;return json},isCoordinate:function(coord){return coord.match(/^([-\d.]+),(\s+)?([-\d.]+)$/)}})})();(function(){"use strict";GoogleMaps.Models.BaseMapObject=GoogleMaps.Models.Base.extend({initializeApi:function(){},edit:function(showMapList){},"delete":function(showMapList){},bindEvents:function(){},reset:function(){},buildInfoWindowContent:function(){var content=this.get("content");var _return=["",_.isArray(content)?content.join(""):content];var t=this,latLng=this.getPosition();_return.push(['
","
"].join(""));var $content=$(_return.join(""));$content.find(".edit").click(function(e){t.edit();e.preventDefault()});$content.find(".delete").click(function(e){t.delete();e.preventDefault()});return $content.get(0)},remove:function(){this.get("infowindow").close();this.set("deleted",true);this.setMap(null)},onDragend:function(e,callback){var t=this;t.set({lat:e.latLng.lat(),lng:e.latLng.lng()});this.get("map").geocoder.geocode({location:e.latLng},function(results,status){if(status=="OK"){t.set("address",results[0].formatted_address);t.set("addressComponents",results[0].address_components)}else{t.set("address",null);t.set("addressComponents",null)}if(!t.get("customContent")){if(!t.isCoordinate(t.get("address"))){t.set("content",t.get("address").split(",").join(" "))}else{t.set("content",t.get("address"))}t.get("infowindow").setContent(t.buildInfoWindowContent())}t.get("map").updateHiddenField();if(_.isFunction(callback)){callback(e)}})}})})();(function(){"use strict";GoogleMaps.Models.Circle=GoogleMaps.Models.BaseMapObject.extend({strokeColor:"#000000",strokeWeight:3,strokeOpacity:.6,fillColor:"#666666",fillOpacity:.6,initialize:function(options){if(!options.strokeColor){options.strokeColor=this.strokeColor}if(!options.strokeOpacity){options.strokeOpacity=this.strokeOpacity}if(!options.strokeWeight){options.strokeWeight=this.strokeWeight}if(!options.fillColor){options.fillColor=this.fillColor}if(!options.fillOpacity){options.fillOpacity=this.fillOpacity}GoogleMaps.Models.Base.prototype.initialize.call(this,options);if(!this.get("radius")){this.set("radius",100)}if(!this.get("api")){this.initializeApi(options)}else{this.get("api").setMap(this.get("map").api)}if(!this.get("infowindow")){this.set("infowindow",new google.maps.InfoWindow({maxWidth:300,content:this.buildInfoWindowContent()}))}this.bindEvents()},convertRadiusToMeters:function(radius,metric){if(!radius){radius=this.get("radius")}if(!metric){metric=this.get("metric")}radius=parseFloat(radius);if(metric=="miles"){radius*=1609.34}else if(metric=="feet"){radius*=.3048}else if(metric=="kilometers"){radius*=1e3}return radius},convertRadiusFromMeters:function(radius,metric){if(!radius){radius=this.get("radius")}if(!metric){metric=this.get("metric")}radius=parseFloat(radius);if(metric=="miles"){radius*=621371e-9}else if(metric=="feet"){radius*=3.28084}else if(metric=="kilometers"){radius*=.001}return radius},hasLocation:function(){return!_.isUndefined(this.get("lat"))&&!_.isUndefined(this.get("lng"))},initializeApi:function(options){if(!_.isObject(options)){options={}}this.set("api",new google.maps.Circle(_.extend({},options,{map:this.hasLocation()?this.get("map").api:null,center:this.hasLocation()?new google.maps.LatLng(this.get("lat"),this.get("lng")):new google.maps.LatLng(0,0),radius:this.convertRadiusToMeters(),draggable:this.get("draggable")?true:false})))},edit:function(showMapList){var t=this,view=new GoogleMaps.Views.CircleForm({model:this,map:this.get("map"),cancel:function(){GoogleMaps.Views.CircleForm.prototype.cancel.call(view);if(showMapList){t.get("map").showMapList()}}});this.get("map").showModal(view)},"delete":function(showMapList){var t=this;var view=new GoogleMaps.Views.BaseForm({template:GoogleMaps.Template("delete-circle-form"),submit:function(){t.get("api").setMap(null);t.set("deleted",true);t.get("map").updateHiddenField();if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}t.get("map").closeInfoWindows()},cancel:function(){if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}}});this.get("map").showModal(view)},getBounds:function(){return this.get("api").getBounds()},getCenter:function(){return this.get("api").getCenter()},getPosition:function(){return this.get("api").getCenter()},getDraggable:function(){return this.get("api").getDraggable()},getEditable:function(){return this.get("api").getEditable()},getMap:function(){return this.get("api").getMap()},getRadius:function(){return this.get("api").getRadius()},getVisible:function(){return this.get("api").getVisible()},setAnimation:function(value){this.get("api").setAnimation(value)},setClickable:function(value){this.get("api").setClickable(value)},setCenter:function(value){this.get("api").setCenter(value)},setDraggable:function(value){this.get("api").setDraggable(value)},setEditable:function(value){this.get("api").setEditable(value)},setMap:function(value){this.get("api").setMap(value)},setOptions:function(value){this.get("api").setOptions(value)},setRadius:function(value){this.get("api").setRadius(this.convertRadiusToMeters(value))},setVisible:function(value){this.get("api").setVisible(value)},bindEvents:function(){var t=this;google.maps.event.addListener(this.get("api"),"center_changed",function(){t.onCenterChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"click",function(){t.onClick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dblclick",function(){t.onDblclick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"drag",function(){t.onDrag.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dragend",function(){t.onDragend.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dragstart",function(){t.onDragstart.apply(t,arguments)
});google.maps.event.addListener(this.get("api"),"mousedown",function(){t.onMousedown.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mousemove",function(){t.onMousemove.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseout",function(){t.onMouseout.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseover",function(){t.onMouseover.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseup",function(){t.onMouseup.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"radius_changed",function(){t.onRadiusChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"rightclick",function(){t.onRightclick.apply(t,arguments)})},onCenterChanged:function(){var center=this.get("api").getCenter();this.set({lat:center.lat(),lng:center.lng()})},onClick:function(e){this.get("map").closeInfoWindows();this.get("infowindow").open(this.get("map").api);this.get("infowindow").setPosition(e.latLng)},onDblclick:function(){},onDrag:function(){},onDragend:function(){GoogleMaps.Models.BaseMapObject.prototype.onDragend.apply(this,arguments)},onDragstart:function(){},onMousedown:function(){},onMousemove:function(){},onMouseover:function(){},onMouseout:function(){},onMouseup:function(){},onRadiusChanged:function(){this.set("radius",Math.round(this.convertRadiusFromMeters(this.get("api").getRadius())*100)/100)},onRightclick:function(){}})})();(function(){"use strict";GoogleMaps.Models.Marker=GoogleMaps.Models.Base.extend({initialize:function(options){GoogleMaps.Models.Base.prototype.initialize.call(this,options);if(!this.get("api")){this.initializeApi(options)}else{this.get("api").setMap(this.get("map").api)}if(this.get("icon")){this.setIcon(this.get("icon"))}if(!this.get("infowindow")){this.set("infowindow",new google.maps.InfoWindow({maxWidth:300,content:this.buildInfoWindowContent()}))}this.bindEvents()},initializeApi:function(options){if(!_.isObject(options)){options={}}this.set("api",new google.maps.Marker(_.extend({},options,{map:this.get("map").api,position:new google.maps.LatLng(this.get("lat"),this.get("lng")),draggable:this.get("draggable")===false?false:true})))},isCoordinate:function(coord){return coord.match(/^([-\d.]+),(\s+)?([-\d.]+)$/)},edit:function(showMapList){var t=this,view=new GoogleMaps.Views.MarkerForm({model:this,map:this.get("map"),cancel:function(){GoogleMaps.Views.MarkerForm.prototype.cancel.call(view);if(showMapList){t.get("map").showMapList()}}});this.get("map").showModal(view)},"delete":function(showMapList){var t=this;var view=new GoogleMaps.Views.BaseForm({template:GoogleMaps.Template("delete-marker-form"),submit:function(){t.get("api").setMap(null);t.set("deleted",true);t.get("map").updateHiddenField();if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}},cancel:function(){if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}}});this.get("map").showModal(view)},buildInfoWindowContent:function(){var content=this.get("content");var _return=["",_.isArray(content)?content.join(""):content];var t=this,latLng=this.get("api").getPosition();_return.push(['
","
"].join(""));var $content=$(_return.join(""));$content.find(".edit").click(function(e){t.edit();e.preventDefault()});$content.find(".delete").click(function(e){t.delete();e.preventDefault()});return $content.get(0)},remove:function(){this.get("infowindow").close();this.set("deleted",true);this.setMap(null)},getAnimation:function(){return this.get("api").getAnimation()},getClickable:function(){return this.get("api").getClickable()},getCursor:function(){return this.get("api").getCursor()},getDraggable:function(){return this.get("api").getDraggable()},getIcon:function(){return this.get("api").getIcon()},getMap:function(){return this.get("api").getMap()},getOpacity:function(){return this.get("api").getOpacity()},getPosition:function(){return this.get("api").getPosition()},getShape:function(){return this.get("api").getShape()},getTitle:function(){return this.get("api").getTitle()},getVisible:function(){return this.get("api").getVisible()},getZIndex:function(){return this.get("api").getZIndex()},setAnimation:function(value){this.get("api").setAnimation(value)},setClickable:function(value){this.get("api").setClickable(value)},setCursor:function(value){this.get("api").setCursor(value)},setDraggable:function(value){this.get("api").setDraggable(value)},setIcon:function(value){if(value){var width=this.get("scaledWidth")?this.get("scaledWidth"):32;var height=this.get("scaledHeight")?this.get("scaledHeight"):32;var icon={scaledSize:new google.maps.Size(width,height),url:value};if(this.get("scaleIcons")===false){this.get("api").setIcon(value)}else{this.get("api").setIcon(icon)}}else{this.get("api").setIcon(null)}},setMap:function(value){this.get("api").setMap(value)},setOpacity:function(value){this.get("api").setOpacity(value)},setOptions:function(value){this.get("api").setOptions(value)},setPosition:function(value){this.get("api").setPosition(value)},setShape:function(value){this.get("api").setShape(value)},setTitle:function(value){this.get("api").setTitle(value)},setVisible:function(value){this.get("api").setVisible(value)},setZIndex:function(value){this.get("api").setZIndex(value)},bindEvents:function(){var t=this;google.maps.event.addListener(this.get("api"),"animation_changed",function(){t.onAnimationChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"click",function(){t.onClick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"cursor_changed",function(){t.onCursorChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dblclick",function(){t.onDblclick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"drag",function(){t.onDrag.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dragend",function(){t.onDragend.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"draggable_changed",function(){t.onDraggableChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dragstart",function(){t.onDragstart.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"flat_changed",function(){t.onFlatChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"icon_changed",function(){t.onIconChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mousemove",function(){t.onMousemove.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseout",function(){t.onMouseout.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseover",function(){t.onMouseover.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseup",function(){t.onMouseup.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"position_changed",function(){t.onPositionChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"rightclick",function(){t.onRightclick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"shape_changed",function(){t.onShapeChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"tilt_changed",function(){t.onTiltChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"visible_changed",function(){t.onVisibleChanged.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"zindex_changed",function(){t.onZindexChanged.apply(t,arguments)})},onAnimationChanged:function(){},onClick:function(){this.get("map").closeInfoWindows();this.get("infowindow").open(this.get("map").api,this.get("api"))},onCursorChanged:function(){},onDblclick:function(){},onDrag:function(){},onDragend:function(e,callback){var t=this;t.set({lat:e.latLng.lat(),lng:e.latLng.lng()});this.get("map").geocoder.geocode({location:e.latLng},function(results,status){if(status=="OK"){t.set("address",results[0].formatted_address);t.set("addressComponents",results[0].address_components)}else{t.set("address",null);t.set("addressComponents",null)}if(!t.get("customContent")){if(!t.isCoordinate(t.get("address"))){t.set("content",t.get("address").split(",").join(" "))}else{t.set("content",t.get("address"))}t.get("infowindow").setContent(t.buildInfoWindowContent())}t.get("map").updateHiddenField();if(_.isFunction(callback)){callback(e)}})},onDraggableChanged:function(){},onDragstart:function(){},onFlatChanged:function(){},onIconChanged:function(){},onMousemove:function(){},onMouseout:function(){},onMouseover:function(){},onMouseup:function(){},onPositionChanged:function(){},onRightclick:function(){},onShapeChanged:function(){},onTiltChanged:function(){},onVisibleChanged:function(){},onZindexChanged:function(){}})})();(function(){"use strict";GoogleMaps.Models.Polygon=GoogleMaps.Models.Base.extend({api:false,map:false,infowindow:false,editable:false,draggable:false,title:null,content:null,points:[],strokeColor:"#000000",strokeWeight:3,strokeOpacity:.6,fillColor:"#666666",fillOpacity:.6,initialize:function(options){if(!options.strokeColor){options.strokeColor=this.strokeColor}if(!options.strokeOpacity){options.strokeOpacity=this.strokeOpacity}if(!options.strokeWeight){options.strokeWeight=this.strokeWeight}if(!options.fillColor){options.fillColor=this.fillColor}if(!options.fillOpacity){options.fillOpacity=this.fillOpacity}GoogleMaps.Models.Base.prototype.initialize.call(this,options);var points=[];_.each(this.get("points"),function(point){points.push(new google.maps.LatLng(point.lat,point.lng))});if(!this.get("api")){this.initializeApi(points,options)}if(!this.get("infowindow")){this.set("infowindow",new google.maps.InfoWindow({maxWidth:300,content:this.buildInfoWindowContent()}))}this.bindEvents()},initializeApi:function(points,options){options.strokeColor=this.get("strokeColor");options.strokeWeight=this.get("strokeWeight");options.strokeOpacity=this.get("strokeOpacity");options.fillColor=this.get("fillColor");options.fillOpacity=this.get("fillOpacity");options.paths=points;options.map=this.get("map").api;options.zIndex=this.get("map").polygons.length;if(!this.get("api")){this.set("api",new google.maps.Polygon(options))}},edit:function(showMapList){var t=this,view=new GoogleMaps.Views.PolygonForm({api:this.get("api"),map:this.get("map"),model:this,cancel:function(){GoogleMaps.Views.PolygonForm.prototype.cancel.call(view);if(showMapList){t.get("map").showMapList()}}});this.get("map").showModal(view)},"delete":function(showMapList){var t=this;var view=new GoogleMaps.Views.BaseForm({template:GoogleMaps.Template("delete-polygon-form"),submit:function(){t.get("api").setMap(null);t.get("infowindow").close();t.set("deleted",true);t.get("map").updateHiddenField();if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}},cancel:function(){if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}}});t.get("map").showModal(view)},remove:function(){this.set("deleted",true);this.setMap(null)},buildInfoWindowContent:function(){var content=this.get("content");var _return=["",_.isArray(content)?content.join(""):content];var t=this;_return.push(['
","
"].join(""));var $content=$(_return.join(""));$content.find(".edit").click(function(e){t.edit();e.preventDefault()});$content.find(".delete").click(function(e){t.delete();e.preventDefault()});return $content.get(0)},getDraggable:function(){return this.get("api").getDraggable()},getEditable:function(){return this.get("api").getEditable()},getMap:function(){return this.get("api").getMap()},getPath:function(){return this.get("api").getPath()},getPaths:function(){return this.get("api").getPaths()},getVisible:function(){return this.get("api").getVisible()},setDraggable:function(value){this.get("api").setDraggable(value)},setEditable:function(value){this.get("api").setEditable(value)},setMap:function(value){this.get("api").setMap(value)},setOptions:function(value){this.get("api").setOptions(value)},setPath:function(value){this.get("api").setPath(value)},setPaths:function(value){this.get("api").setPaths(value)},setPoints:function(value){var points=[];_.each(value,function(point){points.push(new google.maps.LatLng(point.lat,point.lng))});this.setPath(points)},setVisible:function(value){this.get("api").setVisible(value)},toJSON:function(){var json=GoogleMaps.Models.Base.prototype.toJSON.call(this);var points=[];if(this.get("api").getPath()){_.each(this.get("api").getPath().getArray(),function(latLng){points.push({lat:latLng.lat(),lng:latLng.lng()})})}json.points=points;return json},bindEvents:function(){var t=this;google.maps.event.addListener(this.get("api"),"click",function(){t.onClick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dblclick",function(){t.onDblclick.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"drag",function(){t.onDrag.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dragend",function(){t.onDragend.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"dragstart",function(){t.onDragstart.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mousedown",function(){t.onMousedown.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mousemove",function(){t.onMousemove.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseout",function(){t.onMouseout.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseover",function(){t.onMouseover.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"mouseup",function(){t.onMouseup.apply(t,arguments)});google.maps.event.addListener(this.get("api"),"rightclick",function(){t.onRightclick.apply(t,arguments)})},onClick:function(e){if(!this.get("api").getEditable()){this.get("map").closeInfoWindows();this.get("infowindow").open(this.get("map").api);this.get("infowindow").setPosition(e.latLng)}},onDblclick:function(){},onDrag:function(){},onDragend:function(e){},onDragstart:function(){},onMousedown:function(){},onMousemove:function(){},onMouseout:function(){},onMouseover:function(){},onMouseup:function(){},onRightclick:function(){}})})();(function(){"use strict";GoogleMaps.Models.Polyline=GoogleMaps.Models.Polygon.extend({initializeApi:function(points,options){options.strokeColor=this.get("strokeColor");options.strokeWeight=this.get("strokeWeight");options.strokeOpacity=this.get("strokeOpacity");options.path=points;options.map=this.get("map").api;options.zIndex=this.get("map").polygons.length;this.set("api",new google.maps.Polyline(options))},getPaths:function(){return},edit:function(showMapList){var t=this,view=new GoogleMaps.Views.PolylineForm({api:this.get("api"),map:this.get("map"),model:this,cancel:function(){GoogleMaps.Views.PolylineForm.prototype.cancel.call(view);if(showMapList){t.get("map").showMapList()}}});this.get("map").showModal(view)},"delete":function(showMapList){var t=this;var view=new GoogleMaps.Views.BaseForm({template:GoogleMaps.Template("delete-polyline-form"),submit:function(){t.get("api").setMap(null);t.get("infowindow").close();t.set("deleted",true);t.get("map").updateHiddenField();if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}},cancel:function(){if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}}});this.get("map").showModal(view)}})})();(function(){"use strict";GoogleMaps.Models.Route=GoogleMaps.Models.Base.extend({initialize:function(options){var t=this;GoogleMaps.Models.Base.prototype.initialize.call(this,options);if(!this.get("api")){this.set("api",new google.maps.DirectionsRenderer(_.extend({},options,{draggable:false,map:this.get("map").api,suppressInfoWindows:true,suppressMarkers:true,preserveViewport:true,infoWindow:new google.maps.InfoWindow({content:"test"})})))}else{this.get("api").setMap(this.get("map").api)}if(this.get("markers")){var markers=[];_.each(this.get("markers"),function(marker,i){markers.push(new GoogleMaps.Models.RouteMarker(_.extend({},marker,{location:t.getLocations()[i],route:t,map:t.get("map"),onDragend:function(e){GoogleMaps.Models.RouteMarker.prototype.onDragend.call(this,e,function(){t.onDragend.call(t,e)})}})))});this.set("markers",markers)}if(this.getLocations().length){t.render(t.getDirectionsRequestObject())}},remove:function(){this.get("api").setMap(null);this.set("deleted",true);_.each(this.getMarkers(),function(marker){marker.remove()})},getDirectionsRequestObject:function(){return{origin:this.getOrigin(),destination:this.getDestination(),waypoints:this.getWaypoints(),avoidFerries:this.get("avoidFerries"),avoidHighways:this.get("avoidHighways"),avoidTolls:this.get("avoidTolls"),durationInTraffic:this.get("durationInTraffic"),optimizeWaypoints:this.get("optimizeWaypoints"),provideRouteAlternatives:this.get("provideRouteAlternatives"),transitOptions:this.get("transitOptions"),unitSystem:this.get("unitSystem")}},setDraggable:function(value){this.get("api").setOptions({draggable:value})},getOrigin:function(){var locations=this.getLocations();var location=locations[0];if(location){return new google.maps.LatLng(location.lat,location.lng)}return null},getDestination:function(){var locations=this.getLocations();if(locations.length<2){return null}var location=locations[locations.length-1];if(location){return new google.maps.LatLng(location.lat,location.lng)}return null},render:function(request,callback){var t=this;if(!_.isObject(request)){request=this.getDirectionsRequestObject()}this.directionsRequest(request,function(result,status){if(status=="OK"){t.setDirections(result);t.setMap(t.get("map").api)}})},getWaypoints:function(){var waypoints=[],locations=this.getLocations();if(locations.length<3){return[]}_.each(locations,function(location,i){if(i>0&&i",_.isArray(content)?content.join(""):content];var t=this;_return.push(['",""].join(""));var $content=$(_return.join(""));$content.find(".edit").click(function(e){t.edit();e.preventDefault()});$content.find(".delete").click(function(e){t.delete();e.preventDefault()});return $content.get(0)},edit:function(showMapList){var t=this,view=new GoogleMaps.Views.RouteForm({model:this,map:this.get("map"),cancel:function(){GoogleMaps.Views.RouteForm.prototype.cancel.call(view);if(showMapList){t.get("map").showMapList()}}});this.get("map").showModal(view)},"delete":function(showMapList){var t=this;var view=new GoogleMaps.Views.DeleteRouteForm({model:this,submit:function(){t.remove();t.get("map").updateHiddenField();if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}},cancel:function(){if(showMapList){t.get("map").showMapList()}else{t.get("map").hideModal()}}});this.get("map").showModal(view)},getDirections:function(){return this.get("api").getDirections()},addLocation:function(location){var t=this;var locations=this.getLocations();var i=locations.length;if(!locations){locations=[]}locations.push(location);this.set("locations",locations);var marker=new GoogleMaps.Models.RouteMarker({scaledWidth:22,scaledHeight:40,route:this,map:this.get("map"),lat:location.lat,lng:location.lng,address:location.address,draggable:true,content:location.address.split(",").join(" "),location:location,onDragend:function(e){GoogleMaps.Models.RouteMarker.prototype.onDragend.call(this,e,function(){t.onDragend.call(t,e)})}});this.addMarker(marker)},removeLocation:function(index){var locations=this.getLocations();if(locations[index]){locations.splice(index,1)}this.set("locations",locations);this.removeMarker(index)},addMarker:function(marker){var markers=this.getMarkers();if(!markers){markers=[]}markers.push(marker);this.updateMarkerIcons();this.set("markers",markers)},removeMarker:function(index){var markers=this.getMarkers();if(markers[index]){markers[index].setMap(null);markers.splice(index,1)}this.updateMarkerIcons();this.set("markers",markers)},onDragend:function(e){},updateMarkerIcons:function(){var t=this;_.each(this.getMarkers(),function(marker,i){if(i=0){buttons.push(button)}})}this.model.set("buttons",buttons)},onRender:function(){var t=this;if(this.options.buttons){_.each(this.options.buttons,function(button,i){if(button.click){t.$el.find("a").eq(i).click(function(e){button.click.call(this,e)})}})}}})})();(function(){"use strict";GoogleMaps.Views.CircleForm=GoogleMaps.Views.BaseForm.extend({geocoder:false,template:GoogleMaps.Template("circle-form"),map:false,api:false,originalCircle:{},initialize:function(options){var t=this;this.model=false;this.geocoder=new google.maps.Geocoder;GoogleMaps.Views.BaseForm.prototype.initialize.call(this,options);this.initializeApi();this.model.get("infowindow").close();this.model.get("api").setDraggable(true);this.model.get("api").setEditable(true);this.api=this.model.get("api")},initializeApi:function(){if(!this.model){this.model=new GoogleMaps.Models.Circle({map:this.map,hideDetails:true,isNew:true,isSavedToMap:false,metric:"miles",radius:100})}this.originalCircle=this.model.toJSON()},onRender:function(){var t=this;GoogleMaps.Views.BaseForm.prototype.onRender.call(this);this.model.onRadiusChanged=function(){GoogleMaps.Models.Circle.prototype.onRadiusChanged.call(this);if(!t.isDestroyed){t.render()}};this.model.onCenterChanged=function(){GoogleMaps.Models.Circle.prototype.onCenterChanged.call(this);if(!t.isDestroyed){t.render()}};this.model.onDragend=function(e){GoogleMaps.Models.Circle.prototype.onDragend.call(this,e,function(){if(!t.isDestroyed){t.render()}})};this.$el.find(".toggle-details").click(function(e){var $panel=t.$el.find(".details");if($panel.css("display")=="none"){$panel.show();t.model.set("hideDetails",false);$(this).html("Hide Details")}else{$panel.hide();t.model.set("hideDetails",true);$(this).html("Show Details")}t.$el.find("input").focus();e.preventDefault()});this.$el.find("input").keypress(function(e){if(e.keyCode==13){t.$el.find(".add-point").click();e.preventDefault()}}).focus();this.$el.find(".set-location").click(function(e){var view=new GoogleMaps.Views.Geocoder({map:t.map,responseHandler:function(response){t.model.set({address:response.formatted_address,addressComponents:response.address_components,lat:response.geometry.location.lat(),lng:response.geometry.location.lng(),isSavedToMap:false});t.model.setCenter(response.geometry.location);t.isDestroyed=false;t.map.showModal(t)},cancel:function(){t.isDestroyed=false;t.map.showModal(t)}});t.map.showModal(view);t.model.setMap(t.map.api);e.preventDefault()});this.$el.find('[name="radius"]').blur(function(){if(t.model.get("radius")!=parseFloat($(this).val())){t.model.setRadius($(this).val())}});this.$el.find('[name="metric"]').change(function(){t.model.set("metric",$(this).val());t.model.setRadius(t.model.get("radius"))});this.$el.find('[name="metric"]').val(this.model.get("metric"));this.$el.find(".oh-google-map-tag a").click(function(e){var index=$(this).parent().index();t.removePoint(index);e.preventDefault()});this.$el.find(".simple-color-picker").simpleColorPicker().blur(function(){t.updatePolygonOptions()}).blur();this.$el.find(".slider").each(function(){var value=$(this).data("value");var start=$(this).data("start");var step=$(this).data("step");var min=$(this).data("min");var max=$(this).data("max");$(this).noUiSlider({start:parseFloat(value?value:start),step:parseFloat(step),range:{min:parseFloat(min),max:parseFloat(max)}}).change(function(e,value){$(this).next().val(value);t.updatePolygonOptions()});$(this).next().val($(this).val())});t.updatePolygonOptions()},updatePolygonOptions:function(){var options={strokeColor:this.$el.find('[name="strokeColor"]').val(),strokeOpacity:this.$el.find('[name="strokeOpacity"]').val(),strokeWeight:this.$el.find('[name="strokeWeight"]').val(),fillColor:this.$el.find('[name="fillColor"]').val(),fillOpacity:this.$el.find('[name="fillOpacity"]').val(),title:this.$el.find('[name="title"]').val(),content:this.$el.find('[name="content"]').val()};this.model.set(options);this.api.setOptions(options)},onShow:function(){var t=this;this.map.closeInfoWindows();this.map.api.setOptions({disableDoubleClickZoom:true});setTimeout(function(){t.$el.find("input").focus()},250)},onDestroy:function(){if(!this.model.get("isSavedToMap")&&this.model.get("isNew")){this.api.setMap(null)}this.map.api.setOptions({disableDoubleClickZoom:false})},isCoordinate:function(coord){return coord.match(/^([-\d.]+),(\s+)?([-\d.]+)$/)},saveToMap:function(){if(!this.model.get("isSavedToMap")){this.map.circles.push(this.model);this.model.set("isSavedToMap",true)}},submit:function(){this.api.setDraggable(false);this.api.setEditable(false);this.model.set({title:this.$el.find('[name="title"]').val(),content:this.$el.find('[name="content"]').val()});this.saveToMap();this.updatePolygonOptions();if(this.model.get("infowindow")){this.model.get("infowindow").setOptions({content:this.model.buildInfoWindowContent()})}this.map.hideModal();this.map.updateHiddenField()},reset:function(){this.model.setRadius(this.originalCircle.radius);this.model.setCenter(new google.maps.LatLng(this.originalCircle.lat,this.originalCircle.lng));this.model.set(this.originalCircle);this.model.setOptions({strokeOpacity:this.originalCircle.strokeOpacity,strokeColor:this.originalCircle.strokeColor,strokeWeight:this.originalCircle.strokeWeight,fillOpacity:this.originalCircle.fillOpacity,fillColor:this.originalCircle.fillColor})},cancel:function(){this.reset();this.model.setDraggable(false);this.model.setEditable(false);this.map.hideModal()}})})();(function(){"use strict";GoogleMaps.Views.DeleteRouteForm=GoogleMaps.Views.BaseForm.extend({template:GoogleMaps.Template("delete-route-form")})})();(function(){"use strict";GoogleMaps.Views.Geocoder=GoogleMaps.Views.BaseForm.extend({className:"oh-google-map-form oh-google-map-geocoder",template:GoogleMaps.Template("geocoder"),api:false,lastResponse:false,dblclickEvent:false,initialize:function(options){GoogleMaps.Views.BaseForm.prototype.initialize.call(this,options);if(!this.model){this.model=new Backbone.Model}this.api=new google.maps.Geocoder},onShow:function(){var t=this;setTimeout(function(){t.$el.find("input").focus()},250);this.map.api.setOptions({disableDoubleClickZoom:true});this.dblclickEvent=google.maps.event.addListener(this.map.api,"dblclick",function(e){t.geocode({location:e.latLng},function(results,status){t.responseHandler(results[0]);
diff --git a/resources/js/app/templates/circle-form.handlebars b/resources/js/app/templates/circle-form.handlebars
index 64cf9fe..88ea2bd 100644
--- a/resources/js/app/templates/circle-form.handlebars
+++ b/resources/js/app/templates/circle-form.handlebars
@@ -37,12 +37,15 @@
Metric
+
+
Feet
Miles
Metres
Kilometres
+
{{/if}}
diff --git a/resources/js/templates.js b/resources/js/templates.js
index c928c57..79af2d8 100644
--- a/resources/js/templates.js
+++ b/resources/js/templates.js
@@ -83,7 +83,7 @@ function program5(depth0,data,depth1) {
+ escapeExpression(((stack1 = (depth1 && depth1.lng)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ "\n
\n \n \n Radius \n \n
\n \n Metric \n \n Feet \n Miles \n Metres \n Kilometres \n \n
\n \n ";
+ + "\" class=\"text fullwidth\" />\n \n \n
Metric \n\n
\n \n Feet \n Miles \n Metres \n Kilometres \n \n
\n
\n \n ";
return buffer;
}