From 059aed3350948ef5fee0503093be02c1cc7f15ce Mon Sep 17 00:00:00 2001 From: Jan Marsch Date: Mon, 3 Mar 2014 02:10:07 +0100 Subject: [PATCH] reverting viewport margin --- dist/OSMBuildings-Leaflet.debug.js | 23 +- dist/OSMBuildings-Leaflet.js | 92 ++++---- dist/OSMBuildings-Leaflet.js.gz | Bin 10032 -> 10009 bytes dist/OSMBuildings-OpenLayers.debug.js | 23 +- dist/OSMBuildings-OpenLayers.js | 80 +++---- dist/OSMBuildings-OpenLayers.js.gz | Bin 10015 -> 9991 bytes lib/suncalc | 1 + src/Layers.js | 10 +- src/adapter.js | 12 +- src/engines/_ArcGIS.js | 309 ++++++++++++++++++++++++++ src/engines/_GoogleMaps.js | 98 ++++++++ src/variables.js | 1 - 12 files changed, 527 insertions(+), 122 deletions(-) create mode 160000 lib/suncalc create mode 100644 src/engines/_ArcGIS.js create mode 100644 src/engines/_GoogleMaps.js diff --git a/dist/OSMBuildings-Leaflet.debug.js b/dist/OSMBuildings-Leaflet.debug.js index 3a4bbad..52edc49 100644 --- a/dist/OSMBuildings-Leaflet.debug.js +++ b/dist/OSMBuildings-Leaflet.debug.js @@ -1040,7 +1040,6 @@ function getTangents(c1, r1, c2, r2) { var WIDTH = 0, HEIGHT = 0, // though this looks like a constant it's needed for distinguishing from local vars CENTER_X = 0, CENTER_Y = 0, - MARGIN = 200, originX = 0, originY = 0, zoom, size, @@ -2034,8 +2033,8 @@ var Layers = { i, il, item; - canvas.width = WIDTH - 2*MARGIN; - canvas.height = HEIGHT - 2*MARGIN; + canvas.width = WIDTH; + canvas.height = HEIGHT; // end fade in clearInterval(animTimer); @@ -2053,7 +2052,7 @@ var Layers = { if (item.style.opacity !== '') { context.globalAlpha = parseFloat(item.style.opacity); } - context.drawImage(item, -MARGIN, -MARGIN); + context.drawImage(item, 0, 0); context.globalAlpha = 1; } @@ -2062,8 +2061,8 @@ var Layers = { // usually called after move: container jumps by move delta, cam is reset setPosition: function(x, y) { - this.container.style.left = (x-MARGIN) +'px'; - this.container.style.top = (y-MARGIN) +'px'; + this.container.style.left = x +'px'; + this.container.style.top = y +'px'; } }; @@ -2090,23 +2089,23 @@ Layers.init(); //****** file: adapter.js ****** function setOrigin(origin) { - originX = origin.x-MARGIN; - originY = origin.y-MARGIN; + originX = origin.x; + originY = origin.y; } function setCamOffset(offset) { camX = CENTER_X + offset.x; - camY = HEIGHT - MARGIN + offset.y; + camY = HEIGHT + offset.y; } function setSize(size) { - WIDTH = size.w + 2*MARGIN; - HEIGHT = size.h + 2*MARGIN; + WIDTH = size.w; + HEIGHT = size.h; CENTER_X = WIDTH /2 <<0; CENTER_Y = HEIGHT/2 <<0; camX = CENTER_X; - camY = HEIGHT-MARGIN; + camY = HEIGHT; Layers.setSize(WIDTH, HEIGHT); maxHeight = camZ-50; diff --git a/dist/OSMBuildings-Leaflet.js b/dist/OSMBuildings-Leaflet.js index 7df150d..181e9fb 100644 --- a/dist/OSMBuildings-Leaflet.js +++ b/dist/OSMBuildings-Leaflet.js @@ -1,51 +1,51 @@ -var OSMBuildings=function(){function wa(a,c){var b=a.x-c.x,d=a.y-c.y;return b*b+d*d}function Pa(a){for(var c=Infinity,b=-Infinity,d=Infinity,e=-Infinity,f=0,g=a.length-3;f=c?90:1<=c?-90:za*(2*Ra(Sa(H*(1-2*c)))-K);b[Ta]=360*(1===a?1:(a%1+1)%1)-180;return b}function Aa(a,c,b){function d(a){if("XDomainRequest"in R&&a!==e.readyState&&(e.readyState=a,e.onreadystatechange))e.onreadystatechange()}a=a.replace(/\{ *([\w_]+) *\}/g,function(a,b){return c[b]||a});var e="XDomainRequest"in R?new XDomainRequest:new XMLHttpRequest;e.onerror=function(){e.status=500;e.statusText="Error";d(4)};e.ontimeout=function(){e.status= -408;e.statusText="Timeout";d(4)};e.onprogress=function(){d(3)};e.onload=function(){e.status=200;e.statusText="Ok";d(4)};e.onreadystatechange=function(){4===e.readyState&&e.status&&!(200>e.status||299b&&(b+=1);1b?c:b<2/3?a+6*(c-a)*(2/3-b):a},Xa={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff", -beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc", -darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c", -indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000", -mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee", -palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347", -turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},N=function(a,c,b,d){this.H=a;this.S=c;this.L=b;this.A=d},k=N.prototype;k.toString=function(){var a=Math.min(360,Math.max(0,this.H)),c=Math.min(1,Math.max(0,this.S)),b=Math.min(1,Math.max(0,this.L)),d=Math.min(1,Math.max(0,this.A)),e;if(0===c)a=e=c=b;else{var f=0.5>b?b*(1+c):b+c-b*c,b=2*b-f,a=a/360,c=na(b,f,a+1/3);e=na(b,f,a);a=na(b,f,a-1/3)}c*=255;e*=255;a*=255;return 1=== -d?"#"+(16777216+(c<<16)+(e<<8)+a).toString(16).slice(1,7):"rgba("+[Math.round(c),Math.round(e),Math.round(a),d.toFixed(2)].join()+")"};k.hue=function(a){return new N(this.H*a,this.S,this.L,this.A)};k.saturation=function(a){return new N(this.H,this.S*a,this.L,this.A)};k.lightness=function(a){return new N(this.H,this.S,this.L*a,this.A)};k.alpha=function(a){return new N(this.H,this.S,this.L,this.A*a)};I=function(a){var c=0,b=0,d=0,e=1,f;a=(""+a).toLowerCase().replace("grey","gray");a=Xa[a]||a;if(f=a.match(/^#(\w{2})(\w{2})(\w{2})$/))c= -parseInt(f[1],16),b=parseInt(f[2],16),d=parseInt(f[3],16);if(f=a.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))c=parseInt(f[1],10),b=parseInt(f[2],10),d=parseInt(f[3],10),e=f[4]?parseFloat(f[5]):1;c/=255;b/=255;d/=255;a=Math.max(c,b,d);var g=Math.min(c,b,d),h;f=(a+g)/2;var j=a-g;if(j){g=0.5c.length))return c}},Ya=function(a,c){for(var b in c)a[b]||(a[b]=c[b]);return a},sa=function(a,c){var b={},d=a.tags||{};a.id&&(b.id=a.id);c&&(b.footprint=n.makeWinding(c,n.clockwise));d.height&&(b.height=n.toMeters(d.height));!b.height&& +var OSMBuildings=function(){function ua(a,c){var b=a.x-c.x,d=a.y-c.y;return b*b+d*d}function Na(a){for(var c=Infinity,b=-Infinity,d=Infinity,e=-Infinity,f=0,g=a.length-3;f=c?90:1<=c?-90:xa*(2*Pa(Qa(G*(1-2*c)))-J);b[Ra]=360*(1===a?1:(a%1+1)%1)-180;return b}function ya(a,c,b){function d(a){if("XDomainRequest"in Q&&a!==e.readyState&&(e.readyState=a,e.onreadystatechange))e.onreadystatechange()}a=a.replace(/\{ *([\w_]+) *\}/g,function(a,b){return c[b]||a});var e="XDomainRequest"in Q?new XDomainRequest:new XMLHttpRequest;e.onerror=function(){e.status=500;e.statusText="Error";d(4)};e.ontimeout=function(){e.status= +408;e.statusText="Timeout";d(4)};e.onprogress=function(){d(3)};e.onload=function(){e.status=200;e.statusText="Ok";d(4)};e.onreadystatechange=function(){4===e.readyState&&e.status&&!(200>e.status||299b&&(b+=1);1b?c:b<2/3?a+6*(c-a)*(2/3-b):a},Va={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4", +black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a", +darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c", +lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd", +mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5", +peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee", +wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},M=function(a,c,b,d){this.H=a;this.S=c;this.L=b;this.A=d},k=M.prototype;k.toString=function(){var a=Math.min(360,Math.max(0,this.H)),c=Math.min(1,Math.max(0,this.S)),b=Math.min(1,Math.max(0,this.L)),d=Math.min(1,Math.max(0,this.A)),e;if(0===c)a=e=c=b;else{var f=0.5>b?b*(1+c):b+c-b*c,b=2*b-f,a=a/360,c=la(b,f,a+1/3);e=la(b,f,a);a=la(b,f,a-1/3)}c*=255;e*=255;a*=255;return 1===d?"#"+(16777216+(c<<16)+(e<<8)+a).toString(16).slice(1, +7):"rgba("+[Math.round(c),Math.round(e),Math.round(a),d.toFixed(2)].join()+")"};k.hue=function(a){return new M(this.H*a,this.S,this.L,this.A)};k.saturation=function(a){return new M(this.H,this.S*a,this.L,this.A)};k.lightness=function(a){return new M(this.H,this.S,this.L*a,this.A)};k.alpha=function(a){return new M(this.H,this.S,this.L,this.A*a)};H=function(a){var c=0,b=0,d=0,e=1,f;a=(""+a).toLowerCase().replace("grey","gray");a=Va[a]||a;if(f=a.match(/^#(\w{2})(\w{2})(\w{2})$/))c=parseInt(f[1],16), +b=parseInt(f[2],16),d=parseInt(f[3],16);if(f=a.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))c=parseInt(f[1],10),b=parseInt(f[2],10),d=parseInt(f[3],10),e=f[4]?parseFloat(f[5]):1;c/=255;b/=255;d/=255;a=Math.max(c,b,d);var g=Math.min(c,b,d),h;f=(a+g)/2;var j=a-g;if(j){g=0.5c.length))return c}},Wa=function(a,c){for(var b in c)a[b]||(a[b]=c[b]);return a},qa=function(a,c){var b={},d=a.tags||{};a.id&&(b.id=a.id);c&&(b.footprint=n.makeWinding(c,n.clockwise));d.height&&(b.height=n.toMeters(d.height));!b.height&& d["building:height"]&&(b.height=n.toMeters(d["building:height"]));!b.height&&d.levels&&(b.height=d.levels*n.METERS_PER_LEVEL<<0);!b.height&&d["building:levels"]&&(b.height=d["building:levels"]*n.METERS_PER_LEVEL<<0);d.min_height&&(b.minHeight=n.toMeters(d.min_height));!b.minHeight&&d["building:min_height"]&&(b.minHeight=n.toMeters(d["building:min_height"]));!b.minHeight&&d.min_level&&(b.minHeight=d.min_level*n.METERS_PER_LEVEL<<0);!b.minHeight&&d["building:min_level"]&&(b.minHeight=d["building:min_level"]* n.METERS_PER_LEVEL<<0);d["building:material"]&&(b.wallColor=n.getMaterialColor(d["building:material"]));d["building:facade:material"]&&(b.wallColor=n.getMaterialColor(d["building:facade:material"]));d["building:cladding"]&&(b.wallColor=n.getMaterialColor(d["building:cladding"]));d["building:color"]&&(b.wallColor=d["building:color"]);d["building:colour"]&&(b.wallColor=d["building:colour"]);d["roof:material"]&&(b.roofColor=n.getMaterialColor(d["roof:material"]));d["building:roof:material"]&&(b.roofColor= -n.getMaterialColor(d["building:roof:material"]));d["roof:color"]&&(b.roofColor=d["roof:color"]);d["roof:colour"]&&(b.roofColor=d["roof:colour"]);d["building:roof:color"]&&(b.roofColor=d["building:roof:color"]);d["building:roof:colour"]&&(b.roofColor=d["building:roof:colour"]);b.height=b.height||ra;if("dome"===d["roof:shape"]||"cylinder"===d["building:shape"]||"sphere"===d["building:shape"])b.shape="cylinder",b.radius=n.getRadius(b.footprint),"dome"===d["roof:shape"]&&d["roof:height"]&&(b.roofShape= -"cylinder",b.roofHeight=n.toMeters(d["roof:height"]),b.height=D(0,b.height-b.roofHeight));return b},pa,W,ea,fa;Na=function(a,c){pa={};W={};ea=[];fa=c;for(var b,d=0,e=a.length;dg&&(j=b,g=h)}2d.length))return d},createClosure:function(a){var c=this;return function(b){b=c.parse(b);ta.add(b,a);c.addRenderItems(b,!0)}},parse:function(a){if(!a)return[];if("FeatureCollection"===a.type){a=a.features;var c=this.each,b,d,e,f,g,h,j=[],p,l,m,z,k;b=0;for(d=a.length;bg&&(j=b,g=h)}2d.length))return d},createClosure:function(a){var c=this;return function(b){b=c.parse(b);ra.add(b,a);c.addRenderItems(b,!0)}},parse:function(a){if(!a)return[];if("FeatureCollection"===a.type){a=a.features;var c=this.each,b,d,e,f,g,h,j=[],p,l,m,z,k;b=0;for(d=a.length;ba[c].scale&&(a[c].scale+=0.1,1>r,p=h.minHeight>>r,!(p>ja)&&(l=this.getPixelFootprint(h.footprint))){q=[];if(h.holes){e=0;for(f=h.holes.length;e< -f;e++)(u=this.getPixelFootprint(h.holes[e]))&&q.push(u)}f=e=null;if(h.wallColor&&(m=I(h.wallColor)))e=m.alpha(w),f=""+e.lightness(0.8),e=""+e;k=null;if(h.roofColor&&(m=I(h.roofColor)))k=""+m.alpha(w);n=h.roofHeight>>r;j<=p&&0>=n||g.push({id:h.id,footprint:l,height:G(j,ja),minHeight:p,wallColor:e,altColor:f,roofColor:k,roofShape:h.roofShape,roofHeight:n,center:Pa(l),holes:q.length?q:null,shape:h.shape,radius:h.radius/s})}return g},set:function(a){this.isStatic=!0;this.resetItems();this.addRenderItems(this.staticData= -this.parse(a),!0)},load:function(a){this.url=a||"http://overpass-api.de/api/interpreter?data=[out:json];(way[%22building%22]({s},{w},{n},{e});node(w);way[%22building:part%22=%22yes%22]({s},{w},{n},{e});node(w);relation[%22building%22]({s},{w},{n},{e});way(r);node(w););out;";(this.isStatic=!/(.+\{[nesw]\}){4,}/.test(this.url))?(this.resetItems(),Aa(this.url,{},function(a){this.addRenderItems(this.staticData=this.parse(a),!0)})):this.update()},update:function(){this.resetItems();if(!(15>E))if(this.isStatic)this.addRenderItems(this.staticData); -else if(this.url){var a,c,b,d,e=Z(v,t);a=Z(v+A,t+u);var f=0.0075*Ha(e.latitude/0.0075),g=0.015*Ha(a.longitude/0.015);a=0.0075*Ia(a.latitude/0.0075);for(e=0.015*Ia(e.longitude/0.015);a<=f;a+=0.0075)for(c=e;c<=g;c+=0.015)a=this.cropDecimals(a),c=this.cropDecimals(c),d=a+","+c,(b=ta.get(d))?this.addRenderItems(b):Aa(this.url,{n:this.cropDecimals(a+0.0075),e:this.cropDecimals(c+0.015),s:a,w:c},this.createClosure(d));ta.purge()}},each:function(){}},va={project:function(a,c,b){return{x:(a-S)*b+S<<0,y:(c- -U)*b+U<<0}},drawSolid:function(a,c,b,d,e){for(var f={x:0,y:0},g={x:0,y:0},h,j,p=[],l=0,m=a.length-3;l(h.x-f.x)*(g.y-f.y)&&(this.context.fillStyle=f.xg.x&&f.y>g.y?e:d,this.drawFace([g.x,g.y,f.x,f.y,h.x,h.y,j.x,j.y])),p[l]=h.x,p[l+1]=h.y;return p},drawFace:function(a,c,b){if(a.length){var d,e,f,g; -this.context.beginPath();this.context.moveTo(a[0],a[1]);d=2;for(e=a.length;dj&&k[b]l&&k[b+1]e.scale?e.height*e.scale:e.height,f=y/(y-b),g=d=0,e.minHeight&&(d= -1>e.scale?e.minHeight*e.scale:e.minHeight,g=y/(y-d)),q=e.wallColor||la,r=e.altColor||aa,s=e.roofColor||V,this.context.strokeStyle=r,"cylinder"===e.shape)k=this.drawCylinder({x:e.center.x-v,y:e.center.y-t},e.radius,b,d,q,r),"cylinder"===e.roofShape&&(k=this.drawCylinder({x:e.center.x-v,y:e.center.y-t},e.radius,b+e.roofHeight,b,s)),this.context.fillStyle=s,this.drawCircle(k.c,k.r,!0);else{k=this.drawSolid(k,f,g,q,r);n=[];if(e.holes){b=0;for(d=e.holes.length;b=a.altitude)){c=1/Ga(a.altitude);b=0.45/c;this.direction.x=Fa(a.azimuth)*c;this.direction.y=Wa(a.azimuth)*c;var d,e,f,g,h,j,k,l,m,n,q,r,s,x;a=[];c=[];var y=B.items;this.context.canvas.style.opacity=b/(2*w);this.context.shadowColor=this.blurColor;this.context.shadowBlur=this.blurSize*(w/2);this.context.fillStyle=this.color;this.context.beginPath(); -b=0;for(d=y.length;bj.scale?j.height*j.scale:j.height,k=0,j.minHeight&&(k=1>j.scale?j.minHeight*j.scale:j.minHeight),"cylinder"===j.shape)"cylinder"===j.roofShape&&(h+=j.roofHeight),a.push({shape:j.shape,center:{x:j.center.x-v,y:j.center.y-t},radius:j.radius,h:h,mh:k});else{l=null;e=0;for(f=g.length-3;e(s.x-m)*(r-n)?(1===l&&this.context.lineTo(m,n),l=0,e||this.context.moveTo(m,n),this.context.lineTo(q,r)):(0===l&&this.context.lineTo(s.x,s.y),l=1,e||this.context.moveTo(s.x,s.y),this.context.lineTo(x.x,x.y));k||c.push(g);if(j.holes){e=0;for(f=j.holes.length;ea[c].scale&&(a[c].scale+=0.1,1>r,p=h.minHeight>>r,!(p>ha)&&(l=this.getPixelFootprint(h.footprint))){q=[];if(h.holes){e=0;for(f=h.holes.length;e< +f;e++)(u=this.getPixelFootprint(h.holes[e]))&&q.push(u)}f=e=null;if(h.wallColor&&(m=H(h.wallColor)))e=m.alpha(w),f=""+e.lightness(0.8),e=""+e;k=null;if(h.roofColor&&(m=H(h.roofColor)))k=""+m.alpha(w);n=h.roofHeight>>r;j<=p&&0>=n||g.push({id:h.id,footprint:l,height:F(j,ha),minHeight:p,wallColor:e,altColor:f,roofColor:k,roofShape:h.roofShape,roofHeight:n,center:Na(l),holes:q.length?q:null,shape:h.shape,radius:h.radius/t})}return g},set:function(a){this.isStatic=!0;this.resetItems();this.addRenderItems(this.staticData= +this.parse(a),!0)},load:function(a){this.url=a||"http://overpass-api.de/api/interpreter?data=[out:json];(way[%22building%22]({s},{w},{n},{e});node(w);way[%22building:part%22=%22yes%22]({s},{w},{n},{e});node(w);relation[%22building%22]({s},{w},{n},{e});way(r);node(w););out;";(this.isStatic=!/(.+\{[nesw]\}){4,}/.test(this.url))?(this.resetItems(),ya(this.url,{},function(a){this.addRenderItems(this.staticData=this.parse(a),!0)})):this.update()},update:function(){this.resetItems();if(!(15>D))if(this.isStatic)this.addRenderItems(this.staticData); +else if(this.url){var a,c,b,d,e=Y(v,s);a=Y(v+A,s+u);var f=0.0075*Fa(e.latitude/0.0075),g=0.015*Fa(a.longitude/0.015);a=0.0075*Ga(a.latitude/0.0075);for(e=0.015*Ga(e.longitude/0.015);a<=f;a+=0.0075)for(c=e;c<=g;c+=0.015)a=this.cropDecimals(a),c=this.cropDecimals(c),d=a+","+c,(b=ra.get(d))?this.addRenderItems(b):ya(this.url,{n:this.cropDecimals(a+0.0075),e:this.cropDecimals(c+0.015),s:a,w:c},this.createClosure(d));ra.purge()}},each:function(){}},ta={project:function(a,c,b){return{x:(a-R)*b+R<<0,y:(c- +T)*b+T<<0}},drawSolid:function(a,c,b,d,e){for(var f={x:0,y:0},g={x:0,y:0},h,j,p=[],l=0,m=a.length-3;l(h.x-f.x)*(g.y-f.y)&&(this.context.fillStyle=f.xg.x&&f.y>g.y?e:d,this.drawFace([g.x,g.y,f.x,f.y,h.x,h.y,j.x,j.y])),p[l]=h.x,p[l+1]=h.y;return p},drawFace:function(a,c,b){if(a.length){var d,e,f,g; +this.context.beginPath();this.context.moveTo(a[0],a[1]);d=2;for(e=a.length;dj&&k[b]l&&k[b+1]e.scale?e.height*e.scale:e.height,f=x/(x-b),g=d=0,e.minHeight&&(d= +1>e.scale?e.minHeight*e.scale:e.minHeight,g=x/(x-d)),q=e.wallColor||ja,r=e.altColor||$,t=e.roofColor||U,this.context.strokeStyle=r,"cylinder"===e.shape)k=this.drawCylinder({x:e.center.x-v,y:e.center.y-s},e.radius,b,d,q,r),"cylinder"===e.roofShape&&(k=this.drawCylinder({x:e.center.x-v,y:e.center.y-s},e.radius,b+e.roofHeight,b,t)),this.context.fillStyle=t,this.drawCircle(k.c,k.r,!0);else{k=this.drawSolid(k,f,g,q,r);n=[];if(e.holes){b=0;for(d=e.holes.length;b=a.altitude)){c=1/Ea(a.altitude);b=0.45/c;this.direction.x=Da(a.azimuth)*c;this.direction.y=Ua(a.azimuth)*c;var d,e,f,g,h,j,k,l,m,n,q,r,t,x;a=[];c=[];var y=B.items;this.context.canvas.style.opacity=b/(2*w);this.context.shadowColor=this.blurColor;this.context.shadowBlur=this.blurSize*(w/2);this.context.fillStyle=this.color;this.context.beginPath(); +b=0;for(d=y.length;bj.scale?j.height*j.scale:j.height,k=0,j.minHeight&&(k=1>j.scale?j.minHeight*j.scale:j.minHeight),"cylinder"===j.shape)"cylinder"===j.roofShape&&(h+=j.roofHeight),a.push({shape:j.shape,center:{x:j.center.x-v,y:j.center.y-s},radius:j.radius,h:h,mh:k});else{l=null;e=0;for(f=g.length-3;e(t.x-m)*(r-n)?(1===l&&this.context.lineTo(m,n),l=0,e||this.context.moveTo(m,n),this.context.lineTo(q,r)):(0===l&&this.context.lineTo(t.x,t.y),l=1,e||this.context.moveTo(t.x,t.y),this.context.lineTo(x.x,x.y));k||c.push(g);if(j.holes){e=0;for(f=j.holes.length;eOSM Buildings');B.update()};q.onRemove=function(){var a=this.map;a.attributionControl&&a.attributionControl.removeAttribution('© OSM Buildings'); -a.off({move:this.onMove,moveend:this.onMoveEnd,zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset},this);a.options.zoomAnimation&&a.off("zoomanim",this.onZoom,this);r.remove()};q.onMove=function(){var a=this.getOffset();ha({x:this.offset.x-a.x,y:this.offset.y-a.y});va.render()};q.onMoveEnd=function(){if(this.skipMoveEnd)this.skipMoveEnd=!1;else{var a=this.map,c=this.getOffset(),b=a.getPixelOrigin();this.offset=c;r.setPosition(-c.x,-c.y);ha({x:0,y:0}); -Ba({w:a._size.x,h:a._size.y});ga({x:b.x-c.x,y:b.y-c.y});r.render();B.update()}};q.onZoomStart=function(){X=!0;r.render()};q.onZoom=function(){};q.onZoomEnd=function(){var a=this.map,c=this.getOffset(),b=a.getPixelOrigin();ga({x:b.x-c.x,y:b.y-c.y});a=a._zoom;X=!1;Ca(a);B.update();r.render();this.skipMoveEnd=!0};q.onResize=function(){};q.onViewReset=function(){var a=this.getOffset();this.offset=a;r.setPosition(-a.x,-a.y);ha({x:0,y:0})};q.getOffset=function(){return L.DomUtil.getPosition(this.map._mapPane)}; -q.setStyle=function(a){a=a||{};var c;if(c=a.color||a.wallColor)F=I(c),la=""+F.alpha(w),ba=F.lightness(0.8),aa=""+ba.alpha(w),M=F.lightness(1.2),V=""+M.alpha(w);a.roofColor&&(M=I(a.roofColor),V=""+M.alpha(w));void 0!==a.shadows&&(Y.enabled=!!a.shadows);r.render();return this};q.setDate=function(a){Y.date=a;Y.render();return this};q.loadData=function(a){B.load(a);return this};q.setData=function(a){B.set(a);return this};q.each=function(a,c){B.each=function(b){return a.call(c,b)};return this};q.screenshot= -function(a){var c=r.screenshot();a&&(R.location.href=c.replace("image/png","image/octet-stream"));return c};k.VERSION="0.1.9a";k.ATTRIBUTION='© OSM Buildings';return k}(); +a.off({move:this.onMove,moveend:this.onMoveEnd,zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset},this);a.options.zoomAnimation&&a.off("zoomanim",this.onZoom,this);r.remove()};q.onMove=function(){var a=this.getOffset();fa({x:this.offset.x-a.x,y:this.offset.y-a.y});ta.render()};q.onMoveEnd=function(){if(this.skipMoveEnd)this.skipMoveEnd=!1;else{var a=this.map,c=this.getOffset(),b=a.getPixelOrigin();this.offset=c;r.setPosition(-c.x,-c.y);fa({x:0,y:0}); +za({w:a._size.x,h:a._size.y});a=b.y-c.y;v=b.x-c.x;s=a;r.render();B.update()}};q.onZoomStart=function(){W=!0;r.render()};q.onZoom=function(){};q.onZoomEnd=function(){var a=this.map,c=this.getOffset(),b=a.getPixelOrigin(),d=b.y-c.y;v=b.x-c.x;s=d;a=a._zoom;W=!1;Aa(a);B.update();r.render();this.skipMoveEnd=!0};q.onResize=function(){};q.onViewReset=function(){var a=this.getOffset();this.offset=a;r.setPosition(-a.x,-a.y);fa({x:0,y:0})};q.getOffset=function(){return L.DomUtil.getPosition(this.map._mapPane)}; +q.setStyle=function(a){a=a||{};var c;if(c=a.color||a.wallColor)E=H(c),ja=""+E.alpha(w),aa=E.lightness(0.8),$=""+aa.alpha(w),K=E.lightness(1.2),U=""+K.alpha(w);a.roofColor&&(K=H(a.roofColor),U=""+K.alpha(w));void 0!==a.shadows&&(X.enabled=!!a.shadows);r.render();return this};q.setDate=function(a){X.date=a;X.render();return this};q.loadData=function(a){B.load(a);return this};q.setData=function(a){B.set(a);return this};q.each=function(a,c){B.each=function(b){return a.call(c,b)};return this};q.screenshot= +function(a){var c=r.screenshot();a&&(Q.location.href=c.replace("image/png","image/octet-stream"));return c};k.VERSION="0.1.9a";k.ATTRIBUTION='© OSM Buildings';return k}(); diff --git a/dist/OSMBuildings-Leaflet.js.gz b/dist/OSMBuildings-Leaflet.js.gz index 337b512753882cba6f4a004cd8420229c07548b5..b2a5e7fd4bae82e3b2c22426a62f0b97c8d87995 100644 GIT binary patch literal 10009 zcmV+!C+656iwFP!000003(b6cciKqy;QxGzgqiV3P+)9;8-~TG=Vjmud9KX*q4L~@1PxY6Q>5Y zbm{BJpGMPsMI72G(q0MX6|he&GJz379!>I~b7cGDiS4&(-*o9K!zJv}zcQht=Z2%w z9>6_Jw|kJ|P{MUi&G7zihET|pKLHyS;Uf(i=$Ro(LYjm-|}2iwIz&gFY{ zMXe{)JwLNXFhBRa1BpALO=3KR7U|S;`3S#*qMI2yg=yO}J_9gBs?B!A7S%37N}{!!P%bTE^v<+pkw`^HJ-| z=5Rs^K4CaVHGlWgxmvFoU{q4gzL}m!{Ps~DJ`$j}Z+_16M1gFa7EjYSt#Tyq;v|}e`jv*=hbevkzMWNm~L;P?&;v*u>n0l(fRede|9$3IrHGa!MZTrB#ttU;{wR| z<>LLjZo<-x8}&jHCgT~Fi8D%gWHf(z`Kd{m3BVo#Gah+HvaEq0DOt z(Pt71{&$Z|d&cO?E(?=@8MkJ;*|h&o8LI()r@vP78yxW&qtDoS{WMM4iaclZd6AjZ zw=56HZ;Z~n{4OD%FcHQR@;fH7X+&ON!i_WX5)(O#$OlX?OgTE$C$Av2fa=fj$?nLl zXn&pN>X%J+RHGd`{ zqZJkwg2s9RG-Nn!3KY;Ai*yImS~!h+hbQN(ebO@A4l`TM$m$NBIOp!j8TSv5DkTPF zJB~SG8}gaadlpVz?u1J|YW~f){Gsmyr2&5equ&P8T!0yOyi)*QFBxPl%lAbs$Sznq zjj+xsfV^V>ep{xhD^bbe(}~Cr{DJ2}ewtm&v3!2)LW70_Qfw}|#UH2JKcDk6@#3d8&FmIX)Y3 zPZng;a4zclLtML?P8V5>)AQWk@ex8+EUIACW9huI%Aq4cMXjNuL6bQ2c$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t zvvDX0qI=WCYkz@1LKUs;+Ku>nxIAgDemFvWWkBd96uxNlsGHU$kJ-d`w%q*1tKwSc zt{1lSTUkY|9j|c7H@1q4oE3-Mcn8CkAY0X8Gm2MT_VCpS87;!E3;dyvC+OZ@4zDb6 z>GdomF3tK;IP-w=J}aTYO}$u;YkI$8N^67C6(K z&FaMqzAkr=+AhKX diff --git a/dist/OSMBuildings-OpenLayers.debug.js b/dist/OSMBuildings-OpenLayers.debug.js index bf5fa00..889807d 100644 --- a/dist/OSMBuildings-OpenLayers.debug.js +++ b/dist/OSMBuildings-OpenLayers.debug.js @@ -1040,7 +1040,6 @@ function getTangents(c1, r1, c2, r2) { var WIDTH = 0, HEIGHT = 0, // though this looks like a constant it's needed for distinguishing from local vars CENTER_X = 0, CENTER_Y = 0, - MARGIN = 200, originX = 0, originY = 0, zoom, size, @@ -2034,8 +2033,8 @@ var Layers = { i, il, item; - canvas.width = WIDTH - 2*MARGIN; - canvas.height = HEIGHT - 2*MARGIN; + canvas.width = WIDTH; + canvas.height = HEIGHT; // end fade in clearInterval(animTimer); @@ -2053,7 +2052,7 @@ var Layers = { if (item.style.opacity !== '') { context.globalAlpha = parseFloat(item.style.opacity); } - context.drawImage(item, -MARGIN, -MARGIN); + context.drawImage(item, 0, 0); context.globalAlpha = 1; } @@ -2062,8 +2061,8 @@ var Layers = { // usually called after move: container jumps by move delta, cam is reset setPosition: function(x, y) { - this.container.style.left = (x-MARGIN) +'px'; - this.container.style.top = (y-MARGIN) +'px'; + this.container.style.left = x +'px'; + this.container.style.top = y +'px'; } }; @@ -2090,23 +2089,23 @@ Layers.init(); //****** file: adapter.js ****** function setOrigin(origin) { - originX = origin.x-MARGIN; - originY = origin.y-MARGIN; + originX = origin.x; + originY = origin.y; } function setCamOffset(offset) { camX = CENTER_X + offset.x; - camY = HEIGHT - MARGIN + offset.y; + camY = HEIGHT + offset.y; } function setSize(size) { - WIDTH = size.w + 2*MARGIN; - HEIGHT = size.h + 2*MARGIN; + WIDTH = size.w; + HEIGHT = size.h; CENTER_X = WIDTH /2 <<0; CENTER_Y = HEIGHT/2 <<0; camX = CENTER_X; - camY = HEIGHT-MARGIN; + camY = HEIGHT; Layers.setSize(WIDTH, HEIGHT); maxHeight = camZ-50; diff --git a/dist/OSMBuildings-OpenLayers.js b/dist/OSMBuildings-OpenLayers.js index d5c3e8c..ca1081a 100644 --- a/dist/OSMBuildings-OpenLayers.js +++ b/dist/OSMBuildings-OpenLayers.js @@ -1,50 +1,50 @@ -var OSMBuildings=function(){function ua(a,d){var b=a.x-d.x,c=a.y-d.y;return b*b+c*c}function Na(a){for(var d=Infinity,b=-Infinity,c=Infinity,e=-Infinity,f=0,g=a.length-3;f=d?90:1<=d?-90:xa*(2*Pa(Qa(H*(1-2*d)))-K);b[Ra]=360*(1===a?1:(a%1+1)%1)-180;return b}function ya(a,d,b){function c(a){if("XDomainRequest"in U&&a!==e.readyState&&(e.readyState=a,e.onreadystatechange))e.onreadystatechange()}a=a.replace(/\{ *([\w_]+) *\}/g,function(a,b){return d[b]||a});var e="XDomainRequest"in U?new XDomainRequest:new XMLHttpRequest;e.onerror=function(){e.status=500;e.statusText="Error";c(4)};e.ontimeout=function(){e.status= -408;e.statusText="Timeout";c(4)};e.onprogress=function(){c(3)};e.onload=function(){e.status=200;e.statusText="Ok";c(4)};e.onreadystatechange=function(){4===e.readyState&&e.status&&!(200>e.status||299b&&(b+=1);1b?d:b<2/3?a+6*(d-a)*(2/3-b):a},Va={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd", +var OSMBuildings=function(){function ta(a,d){var b=a.x-d.x,c=a.y-d.y;return b*b+c*c}function Ma(a){for(var d=Infinity,b=-Infinity,c=Infinity,e=-Infinity,f=0,g=a.length-3;f=d?90:1<=d?-90:wa*(2*Oa(Pa(G*(1-2*d)))-J);b[Qa]=360*(1===a?1:(a%1+1)%1)-180;return b}function xa(a,d,b){function c(a){if("XDomainRequest"in T&&a!==e.readyState&&(e.readyState=a,e.onreadystatechange))e.onreadystatechange()}a=a.replace(/\{ *([\w_]+) *\}/g,function(a,b){return d[b]||a});var e="XDomainRequest"in T?new XDomainRequest:new XMLHttpRequest;e.onerror=function(){e.status=500;e.statusText="Error";c(4)};e.ontimeout=function(){e.status= +408;e.statusText="Timeout";c(4)};e.onprogress=function(){c(3)};e.onload=function(){e.status=200;e.statusText="Ok";c(4)};e.onreadystatechange=function(){4===e.readyState&&e.status&&!(200>e.status||299b&&(b+=1);1b?d:b<2/3?a+6*(d-a)*(2/3-b):a},Ua={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd", blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b", darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5", lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db", mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f", pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff", -whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},P=function(a,d,b,c){this.H=a;this.S=d;this.L=b;this.A=c},k=P.prototype;k.toString=function(){var a=Math.min(360,Math.max(0,this.H)),d=Math.min(1,Math.max(0,this.S)),b=Math.min(1,Math.max(0,this.L)),c=Math.min(1,Math.max(0,this.A)),e;if(0===d)a=e=d=b;else{var f=0.5>b?b*(1+d):b+d-b*d,b=2*b-f,a=a/360,d=la(b,f,a+1/3);e=la(b,f,a);a=la(b,f,a-1/3)}d*=255;e*=255;a*=255;return 1===c?"#"+(16777216+(d<<16)+(e<<8)+a).toString(16).slice(1,7):"rgba("+ -[Math.round(d),Math.round(e),Math.round(a),c.toFixed(2)].join()+")"};k.hue=function(a){return new P(this.H*a,this.S,this.L,this.A)};k.saturation=function(a){return new P(this.H,this.S*a,this.L,this.A)};k.lightness=function(a){return new P(this.H,this.S,this.L*a,this.A)};k.alpha=function(a){return new P(this.H,this.S,this.L,this.A*a)};I=function(a){var d=0,b=0,c=0,e=1,f;a=(""+a).toLowerCase().replace("grey","gray");a=Va[a]||a;if(f=a.match(/^#(\w{2})(\w{2})(\w{2})$/))d=parseInt(f[1],16),b=parseInt(f[2], -16),c=parseInt(f[3],16);if(f=a.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))d=parseInt(f[1],10),b=parseInt(f[2],10),c=parseInt(f[3],10),e=f[4]?parseFloat(f[5]):1;d/=255;b/=255;c/=255;a=Math.max(d,b,c);var g=Math.min(d,b,c),h;f=(a+g)/2;var j=a-g;if(j){g=0.5b?b*(1+d):b+d-b*d,b=2*b-f,a=a/360,d=ka(b,f,a+1/3);e=ka(b,f,a);a=ka(b,f,a-1/3)}d*=255;e*=255;a*=255;return 1===c?"#"+(16777216+(d<<16)+(e<<8)+a).toString(16).slice(1,7):"rgba("+ +[Math.round(d),Math.round(e),Math.round(a),c.toFixed(2)].join()+")"};k.hue=function(a){return new O(this.H*a,this.S,this.L,this.A)};k.saturation=function(a){return new O(this.H,this.S*a,this.L,this.A)};k.lightness=function(a){return new O(this.H,this.S,this.L*a,this.A)};k.alpha=function(a){return new O(this.H,this.S,this.L,this.A*a)};H=function(a){var d=0,b=0,c=0,e=1,f;a=(""+a).toLowerCase().replace("grey","gray");a=Ua[a]||a;if(f=a.match(/^#(\w{2})(\w{2})(\w{2})$/))d=parseInt(f[1],16),b=parseInt(f[2], +16),c=parseInt(f[3],16);if(f=a.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))d=parseInt(f[1],10),b=parseInt(f[2],10),c=parseInt(f[3],10),e=f[4]?parseFloat(f[5]):1;d/=255;b/=255;c/=255;a=Math.max(d,b,c);var g=Math.min(d,b,c),h;f=(a+g)/2;var j=a-g;if(j){g=0.5d.length))return d}},Wa=function(a,d){for(var b in d)a[b]||(a[b]=d[b]);return a},qa=function(a,d){var b={},c=a.tags||{};a.id&&(b.id=a.id);d&&(b.footprint=n.makeWinding(d,n.clockwise));c.height&&(b.height=n.toMeters(c.height));!b.height&& +a]||null}},Ka,La=function(a){return(a=a.tags)&&!a.landuse&&(a.building||a["building:part"])&&(!a.layer||0<=a.layer)},na=function(a){if(a){for(var d=[],b,c=0,e=a.length;cd.length))return d}},Va=function(a,d){for(var b in d)a[b]||(a[b]=d[b]);return a},pa=function(a,d){var b={},c=a.tags||{};a.id&&(b.id=a.id);d&&(b.footprint=n.makeWinding(d,n.clockwise));c.height&&(b.height=n.toMeters(c.height));!b.height&& c["building:height"]&&(b.height=n.toMeters(c["building:height"]));!b.height&&c.levels&&(b.height=c.levels*n.METERS_PER_LEVEL<<0);!b.height&&c["building:levels"]&&(b.height=c["building:levels"]*n.METERS_PER_LEVEL<<0);c.min_height&&(b.minHeight=n.toMeters(c.min_height));!b.minHeight&&c["building:min_height"]&&(b.minHeight=n.toMeters(c["building:min_height"]));!b.minHeight&&c.min_level&&(b.minHeight=c.min_level*n.METERS_PER_LEVEL<<0);!b.minHeight&&c["building:min_level"]&&(b.minHeight=c["building:min_level"]* n.METERS_PER_LEVEL<<0);c["building:material"]&&(b.wallColor=n.getMaterialColor(c["building:material"]));c["building:facade:material"]&&(b.wallColor=n.getMaterialColor(c["building:facade:material"]));c["building:cladding"]&&(b.wallColor=n.getMaterialColor(c["building:cladding"]));c["building:color"]&&(b.wallColor=c["building:color"]);c["building:colour"]&&(b.wallColor=c["building:colour"]);c["roof:material"]&&(b.roofColor=n.getMaterialColor(c["roof:material"]));c["building:roof:material"]&&(b.roofColor= -n.getMaterialColor(c["building:roof:material"]));c["roof:color"]&&(b.roofColor=c["roof:color"]);c["roof:colour"]&&(b.roofColor=c["roof:colour"]);c["building:roof:color"]&&(b.roofColor=c["building:roof:color"]);c["building:roof:colour"]&&(b.roofColor=c["building:roof:colour"]);b.height=b.height||pa;if("dome"===c["roof:shape"]||"cylinder"===c["building:shape"]||"sphere"===c["building:shape"])b.shape="cylinder",b.radius=n.getRadius(b.footprint),"dome"===c["roof:shape"]&&c["roof:height"]&&(b.roofShape= -"cylinder",b.roofHeight=n.toMeters(c["roof:height"]),b.height=D(0,b.height-b.roofHeight));return b},na,W,da,ea;La=function(a,d){na={};W={};da=[];ea=d;for(var b,c=0,e=a.length;cg&&(j=b,g=h)}2c.length))return c},createClosure:function(a){var d=this;return function(b){b=d.parse(b);ra.add(b,a);d.addRenderItems(b,!0)}},parse:function(a){if(!a)return[];if("FeatureCollection"===a.type){a=a.features;var d=this.each,b,c,e,f,g,h,j=[],p,l,m,z,k;b=0;for(c=a.length;ba[c].scale&&(a[c].scale+=0.1,1>r,p=h.minHeight>>r,!(p>ha)&&(l=this.getPixelFootprint(h.footprint))){q=[];if(h.holes){e=0;for(f=h.holes.length;e< -f;e++)(u=this.getPixelFootprint(h.holes[e]))&&q.push(u)}f=e=null;if(h.wallColor&&(m=I(h.wallColor)))e=m.alpha(w),f=""+e.lightness(0.8),e=""+e;k=null;if(h.roofColor&&(m=I(h.roofColor)))k=""+m.alpha(w);n=h.roofHeight>>r;j<=p&&0>=n||g.push({id:h.id,footprint:l,height:G(j,ha),minHeight:p,wallColor:e,altColor:f,roofColor:k,roofShape:h.roofShape,roofHeight:n,center:Na(l),holes:q.length?q:null,shape:h.shape,radius:h.radius/s})}return g},set:function(a){this.isStatic=!0;this.resetItems();this.addRenderItems(this.staticData= -this.parse(a),!0)},load:function(a){this.url=a||"http://overpass-api.de/api/interpreter?data=[out:json];(way[%22building%22]({s},{w},{n},{e});node(w);way[%22building:part%22=%22yes%22]({s},{w},{n},{e});node(w);relation[%22building%22]({s},{w},{n},{e});way(r);node(w););out;";(this.isStatic=!/(.+\{[nesw]\}){4,}/.test(this.url))?(this.resetItems(),ya(this.url,{},function(a){this.addRenderItems(this.staticData=this.parse(a),!0)})):this.update()},update:function(){this.resetItems();if(!(15>E))if(this.isStatic)this.addRenderItems(this.staticData); -else if(this.url){var a,d,b,c,e=Y(v,t);a=Y(v+B,t+u);var f=0.0075*Fa(e.latitude/0.0075),g=0.015*Fa(a.longitude/0.015);a=0.0075*Ga(a.latitude/0.0075);for(e=0.015*Ga(e.longitude/0.015);a<=f;a+=0.0075)for(d=e;d<=g;d+=0.015)a=this.cropDecimals(a),d=this.cropDecimals(d),c=a+","+d,(b=ra.get(c))?this.addRenderItems(b):ya(this.url,{n:this.cropDecimals(a+0.0075),e:this.cropDecimals(d+0.015),s:a,w:d},this.createClosure(c));ra.purge()}},each:function(){}},ta={project:function(a,d,b){return{x:(a-M)*b+M<<0,y:(d- -N)*b+N<<0}},drawSolid:function(a,d,b,c,e){for(var f={x:0,y:0},g={x:0,y:0},h,j,p=[],l=0,m=a.length-3;l(h.x-f.x)*(g.y-f.y)&&(this.context.fillStyle=f.xg.x&&f.y>g.y?e:c,this.drawFace([g.x,g.y,f.x,f.y,h.x,h.y,j.x,j.y])),p[l]=h.x,p[l+1]=h.y;return p},drawFace:function(a,d,b){if(a.length){var c,e,f,g; -this.context.beginPath();this.context.moveTo(a[0],a[1]);c=2;for(e=a.length;cj&&k[b]l&&k[b+1]e.scale?e.height*e.scale:e.height,f=y/(y-b),g=c=0,e.minHeight&&(c= -1>e.scale?e.minHeight*e.scale:e.minHeight,g=y/(y-c)),q=e.wallColor||ja,r=e.altColor||$,s=e.roofColor||V,this.context.strokeStyle=r,"cylinder"===e.shape)k=this.drawCylinder({x:e.center.x-v,y:e.center.y-t},e.radius,b,c,q,r),"cylinder"===e.roofShape&&(k=this.drawCylinder({x:e.center.x-v,y:e.center.y-t},e.radius,b+e.roofHeight,b,s)),this.context.fillStyle=s,this.drawCircle(k.c,k.r,!0);else{k=this.drawSolid(k,f,g,q,r);n=[];if(e.holes){b=0;for(c=e.holes.length;b=a.altitude)){d=1/Ea(a.altitude);b=0.45/d;this.direction.x=Da(a.azimuth)*d;this.direction.y=Ua(a.azimuth)*d;var c,e,f,g,h,j,k,l,m,n,q,r,s,x;a=[];d=[];var y=A.items;this.context.canvas.style.opacity=b/(2*w);this.context.shadowColor=this.blurColor;this.context.shadowBlur=this.blurSize*(w/2);this.context.fillStyle=this.color;this.context.beginPath(); -b=0;for(c=y.length;bj.scale?j.height*j.scale:j.height,k=0,j.minHeight&&(k=1>j.scale?j.minHeight*j.scale:j.minHeight),"cylinder"===j.shape)"cylinder"===j.roofShape&&(h+=j.roofHeight),a.push({shape:j.shape,center:{x:j.center.x-v,y:j.center.y-t},radius:j.radius,h:h,mh:k});else{l=null;e=0;for(f=g.length-3;e(s.x-m)*(r-n)?(1===l&&this.context.lineTo(m,n),l=0,e||this.context.moveTo(m,n),this.context.lineTo(q,r)):(0===l&&this.context.lineTo(s.x,s.y),l=1,e||this.context.moveTo(s.x,s.y),this.context.lineTo(x.x,x.y));k||d.push(g);if(j.holes){e=0;for(f=j.holes.length;eg&&(j=b,g=h)}2c.length))return c},createClosure:function(a){var d=this;return function(b){b=d.parse(b);qa.add(b,a);d.addRenderItems(b,!0)}},parse:function(a){if(!a)return[];if("FeatureCollection"===a.type){a=a.features;var d=this.each,b,c,e,f,g,h,j=[],p,l,m,A,k;b=0;for(c=a.length;ba[c].scale&&(a[c].scale+=0.1,1>r,p=h.minHeight>>r,!(p>ga)&&(l=this.getPixelFootprint(h.footprint))){q=[];if(h.holes){e=0;for(f=h.holes.length;e< +f;e++)(t=this.getPixelFootprint(h.holes[e]))&&q.push(t)}f=e=null;if(h.wallColor&&(m=H(h.wallColor)))e=m.alpha(w),f=""+e.lightness(0.8),e=""+e;k=null;if(h.roofColor&&(m=H(h.roofColor)))k=""+m.alpha(w);n=h.roofHeight>>r;j<=p&&0>=n||g.push({id:h.id,footprint:l,height:F(j,ga),minHeight:p,wallColor:e,altColor:f,roofColor:k,roofShape:h.roofShape,roofHeight:n,center:Ma(l),holes:q.length?q:null,shape:h.shape,radius:h.radius/x})}return g},set:function(a){this.isStatic=!0;this.resetItems();this.addRenderItems(this.staticData= +this.parse(a),!0)},load:function(a){this.url=a||"http://overpass-api.de/api/interpreter?data=[out:json];(way[%22building%22]({s},{w},{n},{e});node(w);way[%22building:part%22=%22yes%22]({s},{w},{n},{e});node(w);relation[%22building%22]({s},{w},{n},{e});way(r);node(w););out;";(this.isStatic=!/(.+\{[nesw]\}){4,}/.test(this.url))?(this.resetItems(),xa(this.url,{},function(a){this.addRenderItems(this.staticData=this.parse(a),!0)})):this.update()},update:function(){this.resetItems();if(!(15>D))if(this.isStatic)this.addRenderItems(this.staticData); +else if(this.url){var a,d,b,c,e=X(v,s);a=X(v+B,s+t);var f=0.0075*Ea(e.latitude/0.0075),g=0.015*Ea(a.longitude/0.015);a=0.0075*Fa(a.latitude/0.0075);for(e=0.015*Fa(e.longitude/0.015);a<=f;a+=0.0075)for(d=e;d<=g;d+=0.015)a=this.cropDecimals(a),d=this.cropDecimals(d),c=a+","+d,(b=qa.get(c))?this.addRenderItems(b):xa(this.url,{n:this.cropDecimals(a+0.0075),e:this.cropDecimals(d+0.015),s:a,w:d},this.createClosure(c));qa.purge()}},each:function(){}},sa={project:function(a,d,b){return{x:(a-L)*b+L<<0,y:(d- +M)*b+M<<0}},drawSolid:function(a,d,b,c,e){for(var f={x:0,y:0},g={x:0,y:0},h,j,p=[],l=0,m=a.length-3;l(h.x-f.x)*(g.y-f.y)&&(this.context.fillStyle=f.xg.x&&f.y>g.y?e:c,this.drawFace([g.x,g.y,f.x,f.y,h.x,h.y,j.x,j.y])),p[l]=h.x,p[l+1]=h.y;return p},drawFace:function(a,d,b){if(a.length){var c,e,f,g; +this.context.beginPath();this.context.moveTo(a[0],a[1]);c=2;for(e=a.length;cj&&k[b]l&&k[b+1]e.scale?e.height*e.scale:e.height,f=y/(y-b),g=c=0,e.minHeight&&(c= +1>e.scale?e.minHeight*e.scale:e.minHeight,g=y/(y-c)),q=e.wallColor||ia,r=e.altColor||Z,w=e.roofColor||U,this.context.strokeStyle=r,"cylinder"===e.shape)k=this.drawCylinder({x:e.center.x-v,y:e.center.y-s},e.radius,b,c,q,r),"cylinder"===e.roofShape&&(k=this.drawCylinder({x:e.center.x-v,y:e.center.y-s},e.radius,b+e.roofHeight,b,w)),this.context.fillStyle=w,this.drawCircle(k.c,k.r,!0);else{k=this.drawSolid(k,f,g,q,r);n=[];if(e.holes){b=0;for(c=e.holes.length;b=a.altitude)){d=1/Da(a.altitude);b=0.45/d;this.direction.x=Ca(a.azimuth)*d;this.direction.y=Ta(a.azimuth)*d;var c,e,f,g,h,j,k,l,m,n,q,r,u,y;a=[];d=[];var z=x.items;this.context.canvas.style.opacity=b/(2*w);this.context.shadowColor=this.blurColor;this.context.shadowBlur=this.blurSize*(w/2);this.context.fillStyle=this.color;this.context.beginPath(); +b=0;for(c=z.length;bj.scale?j.height*j.scale:j.height,k=0,j.minHeight&&(k=1>j.scale?j.minHeight*j.scale:j.minHeight),"cylinder"===j.shape)"cylinder"===j.roofShape&&(h+=j.roofHeight),a.push({shape:j.shape,center:{x:j.center.x-v,y:j.center.y-s},radius:j.radius,h:h,mh:k});else{l=null;e=0;for(f=g.length-3;e(u.x-m)*(r-n)?(1===l&&this.context.lineTo(m,n),l=0,e||this.context.moveTo(m,n),this.context.lineTo(q,r)):(0===l&&this.context.lineTo(u.x,u.y),l=1,e||this.context.moveTo(u.x,u.y),this.context.lineTo(y.x,y.y));k||d.push(g);if(j.holes){e=0;for(f=j.holes.length;eHYRsg@ubGCo^-;bz&1JY=uIhHh{ck>5~ta?_Mm!$P431M*U^% z=3x>W=7UZ?$(g~3XFl9QWrwoveaGwG6Bkk|NUiLY=gTyH;2?ot97?#(DGVR(M_$`-I-YshACE1v8o6zQcU+m>l!!0Igo#63IcY8??ZBjc zF=?l}0_41oO9IMUyzRGqJM@jGMlhz6*2I*p0(#4g08#1i!vLCge0WUg1pWr}>Y7Z+ zf<*QdtGzTV((8z}wkFt|_Uuk?Oy~Bz1M^9;)7G&{eT(Bd~}adctf+5y@pn z2bN{)%x8X|)8+-%ZQ8DJY;Hv3Je>1nneT1hIJSmc?LW)v)gBgUGD&$>lL@YIq)MZN zd3!tW@8I@fR_%71*ws#s>GmS(o(>M48qo7IonNo}XJ=!bGY<|NtPAKak~rfyE`W?* zE-B zcXkec1N&F{LI@JuXEc|oxAa&09nI|}beLa;-?;ID1~~ePv6j`A?8?0RzBmkP^5lf#K{s+UsE6YFpi-mSHdyYC^P`#Df3bBhwBUz38%N z5isM9~bk^nf3v!8x zD4CGYn8?DIyu^f?WaJelau$;hm|&Pv7_DqkAxNxez$1p!rm(`j zu}F6?t%c9HcX)En+9xf;>oBwBjI8e9nRD)qoN@o~s8V7;w&R#1wjsYW`oN;lZXM;ZLGsrK~Xmyt)*pbJb;Si?bGLPq~vw?rc8H@^>In7hP%=BC= z0ZiN^VuA)<|KzO40hXjJ5?G!3154y%Sm-;Rsvb{{&j#F+1z8x)L|uP~b9d8lo+XH$ z=k|_|5VB%%g`yryXO&qF9SJIG4IK@dB$3DCRLl!zbz*5ausTlv4F72m=d$_9G0qBM zvw+P)Z0b3uC#vb3O@K9Vfrm~xb`piRTz4@ToH%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q9fGIEzkPmZ)W!BYT14Zz zT<=e6pY6M9y;sDsR?@65?jMnYxEDQDW3#dE+bE6=8KJqPU`9mm@XgY+Egr?kgFqec zoW;k!4+s_~miDFSZNfs}QE>V}KVUt{VG)~iqEA$DKJ|-Fm#>FsmUY(Y)iHRChrwc0 z(F$gN18O}-KwKx@#?QVH{nGl!%lA+6uWHu;%(5(*I7=a+{&DEWieD^lBP%tgP5sF|s|(bQ38^~(d|HFaST;i{uxP*-(J9+!zP{doDCJH@@geQ*4z*LsRddtL#O zuly7j0W1ET@exKVL3XMGtBF@74)E%|3^w4~>3{0*Ha$4V;gxMtdc8-H1P?SS6!}vG zyjbj3w$xo=JkT{J^ZTL?-!ph-+uf+ p>sGtdK4WzNJ^S+I^V{dYeL?X5N&%{IW*ZES|9>4?i5$UV004;iTr>ax diff --git a/lib/suncalc b/lib/suncalc new file mode 160000 index 0000000..c10cbdc --- /dev/null +++ b/lib/suncalc @@ -0,0 +1 @@ +Subproject commit c10cbdc6c8c31627fc460497331f99d5037a5887 diff --git a/src/Layers.js b/src/Layers.js index 6489244..14729d8 100644 --- a/src/Layers.js +++ b/src/Layers.js @@ -93,8 +93,8 @@ var Layers = { i, il, item; - canvas.width = WIDTH - 2*MARGIN; - canvas.height = HEIGHT - 2*MARGIN; + canvas.width = WIDTH; + canvas.height = HEIGHT; // end fade in clearInterval(animTimer); @@ -112,7 +112,7 @@ var Layers = { if (item.style.opacity !== '') { context.globalAlpha = parseFloat(item.style.opacity); } - context.drawImage(item, -MARGIN, -MARGIN); + context.drawImage(item, 0, 0); context.globalAlpha = 1; } @@ -121,8 +121,8 @@ var Layers = { // usually called after move: container jumps by move delta, cam is reset setPosition: function(x, y) { - this.container.style.left = (x-MARGIN) +'px'; - this.container.style.top = (y-MARGIN) +'px'; + this.container.style.left = x +'px'; + this.container.style.top = y +'px'; } }; diff --git a/src/adapter.js b/src/adapter.js index 7ec3af4..40f91d5 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -1,21 +1,21 @@ function setOrigin(origin) { - originX = origin.x-MARGIN; - originY = origin.y-MARGIN; + originX = origin.x; + originY = origin.y; } function setCamOffset(offset) { camX = CENTER_X + offset.x; - camY = HEIGHT - MARGIN + offset.y; + camY = HEIGHT + offset.y; } function setSize(size) { - WIDTH = size.w + 2*MARGIN; - HEIGHT = size.h + 2*MARGIN; + WIDTH = size.w; + HEIGHT = size.h; CENTER_X = WIDTH /2 <<0; CENTER_Y = HEIGHT/2 <<0; camX = CENTER_X; - camY = HEIGHT-MARGIN; + camY = HEIGHT; Layers.setSize(WIDTH, HEIGHT); maxHeight = camZ-50; diff --git a/src/engines/_ArcGIS.js b/src/engines/_ArcGIS.js new file mode 100644 index 0000000..902d9d1 --- /dev/null +++ b/src/engines/_ArcGIS.js @@ -0,0 +1,309 @@ +/** + * @name Extruded Feature Layer + * @author: Nianwei Liu + * @fileoverview + * A canvas based ESRI ArcGIS Server JavaScript API ported from Open Streem Map Buildings.(osmbuildings.org). + */ + +/*(function() { + if (!window.OSMBuildings) { + // only include minimal filters: invert and desaturate. If need more, include the pixastic.all.js in header before require this. + var src = dojo.moduleUrl('agsjs', 'osm/OSMBuildings.js'); + var s = dojo.create('script', { + type: 'text/javascript', + src: src + }); + dojo.doc.getElementsByTagName('head')[0].appendChild(s); + } +}()); +*/ +// ********* end of osm *******************/ + +// TODO get rid of dojo + +dojo.provide('agsjs.layers.BuildingsLayer'); + +dojo.declare('agsjs.layers.BuildingsLayer', esri.layers.Layer, { + _osmb: null, + _container: null, + _tileInfo: null, + _mode: 0,// ON_DEMAND|SNAPSHOT + _heightAttribute: '', + _oidField: null,// will be overridden from meta query + _query: null, + _task: null, + _oids: null, //track current objectids to mark new/old for animation fade in + _featureExt: null,//current feature extent, 1.5 map extent + _suspendOnPan: false,//whether to suspend drawing during map panning. default is false. + // set to true if performance is not optimal (non-Chrome browsers); + + /** + * @name BuildingsLayerOptions + * @class This is an object literal that specify the options for each BuildingsLayer. + * @property {string} heightAttribute required. name of the attribute for height; + * @property {number} defaultHeight optional. default Height to use if the height value is 0. default=0; + * @property {number} heightScaleRatio optional. number used to multiple the value from service. default=1; + * @property {number} extentScaleRatio optional. extra buffer on map extent to load features to reduce server traffic. default=1.5; + * @property {int} [mode] optional. agsjs.layers.BuildingsLayer.MODE_ONDEMAND | MODE_SNAPSHOT. default=ON_DEMAND + * @property {esri.tasks.Query} [query] optional. query set on the feature layer for retrieving data. + * @property {Object} [style] object with color, roofColor (#ffcc00' 'rgb(255,200,200)' 'rgba(255,200,200,0.9)) + */ + /** + * Create an BuildingsLayer + * @name BuildingsLayer + * @constructor + * @class This class is a BuildingsLayer, such as a polygon feature layer with a height attribute. + * @param {string||FeatureCollection} url + * @param {BuildingsLayerOptions} opts + */ + constructor: function(url, opts) { + // Manually call superclass constructor with required arguments + if (!(!!document.createElement('canvas').getContext)){ + throw new Error('Canvas unsupported. Try different browser'); + } + this.inherited(arguments); + opts = opts || {}; + this._heightAttribute = opts.heightAttribute; + this._mode = opts.mode || agsjs.layers.BuildingsLayer.MODE_ONDEMAND; + this._heightScaleRatio = opts.heightScaleRatio || 1; + this._extentScaleRatio = opts.extentScaleRatio || 1.5; + this._defaultHeight = opts.defaultHeight || 0; + this._style = opts.style; + // Deal with feature collection + if (dojo.isObject(url) && url.featureSet) { + this._mode = agsjs.layers.BuildingsLayer.MODE_SNAPSHOT; + this._setFeatures(url.featureSet.features); + this.loaded = true; + this.onLoad(this); + } else { + this._url = url; + // get meta data for layer + new esri.request({ + url: this._url, + content: { + f: 'json' + }, + callbackParamName: 'callback' + }).then(dojo.hitch(this, this._initLayer)); + this._query = new esri.tasks.Query(); + dojo.mixin(this._query, opts.query); + dojo.mixin(this._query, { + returnGeometry: true, + outSpatialReference: { wkid: 4326 } + }); + this._task = new esri.tasks.QueryTask(url); + dojo.connect(this._task, 'onComplete', dojo.hitch(this, this._onQueryComplete)); + dojo.connect(this._task, 'onError', esri.config.defaults.io.errorHandler); + } + }, + + /********************** + * @see http://help.arcgis.com/en/webapi/javascript/arcgis/samples/exp_rasterlayer/javascript/RasterLayer.js + * Internal Properties + * + * _map + * _element + * _context + * _mapWidth + * _mapHeight + * _connects + **********************/ + _setMap: function(map, container, ind, lod) { + this._map = map; + + var element = dojo.create('div', { + width: map.width + 'px', + height: map.height + 'px', + style: 'position: absolute; left: 0px; top: 0px;' + }, container); + this._osmb = new OSMBuildings(); + // allow attribution widget to add copyright text + this.suspended = false; + this.copyright = OSMBuildings.ATTRIBUTION + ',' + this.copyrightText; + + this._element = element; + this._container = this._osmb.appendTo(element); + this._osmb.setSize(map.width, map.height); + // calc orgins + //9241483,13264618 + if (map.layerIds.length == 0 || !map.getLayer(map.layerIds[0]).tileInfo) { + throw new Error('must have at least one tiled layer added before this layer'); + } + this._tileInfo = map.getLayer(map.layerIds[0]).tileInfo; + this._osmb.setZoom(map.getLevel()); // ! assume basemap is tiled. + this._setOrigin(); + + this._loadData(); + // Event connections + this._connects = []; + this._connects.push(dojo.connect(map, 'onResize', this, this._onResize)); + this._connects.push(dojo.connect(map, 'onPan', this, this._onPan)); + this._connects.push(dojo.connect(map, 'onExtentChange', this, this._onExtentChange)); + this._connects.push(dojo.connect(map, 'onZoomStart', this, this._onZoomStart)); + return element; + }, + // esri.layers.Layer.method + _unsetMap: function(map, container) { + if (this._osmb) { + this._container.parentNode.removeChild(this._container); + this._osmb = null; + } + dojo.forEach(this._connects, dojo.disconnect, dojo); + if (this._element) { + container.removeChild(this._element); + } + this._map = null; + this._element = null; + }, + _initLayer: function(json) { + //dojo.mixin(this, json); + this.setMinScale(json.minScale || 0); + this.setMaxScale (json.maxScale || 0); + this.copyrightText = json.copyrightText; + dojo.some(json.fields, function(field, i) { + if (field.type == 'esriFieldTypeOID') { + this._oidField = field.name; + return true; + } + return false; + }, this); + this._query.outFields = [this._oidField, this._heightAttribute]; + this.loaded = true; + this.onLoad(this); + }, + _setOrigin: function(dx, dy) { + var resolution = this._tileInfo.lods[this._map.getLevel()].resolution; //map.getScale()/12/96/3.28084; //inch_pre_ft/px_per_in/ft_per_mt; + var topLeft = this._map.toMap(new esri.geometry.Point(0, 0)); + var x = Math.round((topLeft.x - this._tileInfo.origin.x) / resolution); + var y = Math.round((this._tileInfo.origin.y - topLeft.y) / resolution); + this._osmb.setOrigin(x+(dx||0), y+(dy||0)); + this._osmb.setSize(this._map.width, this._map.height); + + }, + _onResize: function(extent, width, height) { + if (this._osmb) { + this._osmb.setSize(width,height ); + this._osmb.render(); + } + }, + _onPan: function(extent, delta) { + if (this._suspendOnPan){ + dojo.style(this._container, { + left: delta.x + 'px', + top: delta.y + 'px' + }); + //this._osmb.setCamOffset(-delta.x, -delta.y); + } else { + this._setOrigin(-delta.x, -delta.y); + this._osmb.render(); + } + }, + _onExtentChange: function(extent, delta, levelChange, lod) { + dojo.style(this._container, { + left: 0, + top: 0 + }); + this._setOrigin(); + this._osmb.setCamOffset(0, 0); + if (levelChange) { + this._osmb.onZoomEnd({ + zoom: this._map.getLevel() + }); + + if (this.isVisibleAtScale(this._map.getScale())) { + this._loadData(); + } else { + // clear canvas. Current OSMB does not handle null or {} as no feature. + this._osmb.geoJSON({ + features: [] + }); + } + } else { + this._osmb.onMoveEnd(); + if (this._featureExt && !this._featureExt.contains(extent)) { + this._loadData(); + } + } + }, + _onZoomStart: function(extent, zoomFactor, anchor, level) { + // actually clear the + this._osmb.onZoomStart(); + }, + _setFeatures: function(features) { + var oids = {}; + var jfs = []; + this._oids = this._oids ||{}; + for (var i = 0; i < features.length; i++) { + var f = features[i]; + + var oid = f.attributes[this._oidField]; + var gj = { + type: 'Feature', + geometry: { + type: 'Polygon', + coordinates: f.geometry.rings + }, + properties: { + height: (f.attributes[this._heightAttribute] || this._defaultHeight) * this._heightScaleRatio, + isNew: !this._oids[oid] + } + } + // find out the y coords range for sorting + var minY = maxY = f.geometry.rings[0][0][1]; + for (var j = 0; j < f.geometry.rings.length; j++){ + for (var k = 0; k < f.geometry.rings[j].length; k++){ + minY = Math.min(minY,f.geometry.rings[j][k][1] ); + maxY = Math.max(maxY,f.geometry.rings[j][k][1] ); + } + } + gj.minY = minY; + gj.maxY = maxY; + jfs[i] = gj; + oids[oid] = f; + } + // sort features by height and y coord desc for potential drawing improvement + jfs.sort(function (a, b){ + // if polygon a is completely north of b then put a first. + // otherwise put the taller one first. + // this ensures north/taller poly draw first + if (a.maxY < b.minY){ + return 1; + } else if (a.minY > b.maxY){ + return -1; + } else { + return b.properties.height - a.properties.height + } + }); + this._oids = oids; + this._osmb.geoJSON({ + type: 'FeatureCollection', + features: jfs + }); + if (this._style) { + this._osmb.setStyle(this._style); + } + }, + _loadData: function() { + if (this._mode == agsjs.layers.BuildingsLayer.MODE_SNAPSHOT) { + if (this._oids) { + return; + } else { + this._query.geometry = null; + this._query.where = this._query.where || '1=1'; + + } + } else { + this._featureExt = this._map.extent.expand(this._extentScaleRatio); + this._query.geometry = this._featureExt; + } + this._task.execute(this._query); + }, + _onQueryComplete: function(featureSet) { + this._setFeatures(featureSet.features); + } +}); + +dojo.mixin(agsjs.layers.BuildingsLayer, { + MODE_ONDEMAND: 0, + MODE_SNAPSHOT: 1 +}); diff --git a/src/engines/_GoogleMaps.js b/src/engines/_GoogleMaps.js new file mode 100644 index 0000000..ce7d642 --- /dev/null +++ b/src/engines/_GoogleMaps.js @@ -0,0 +1,98 @@ +var osmb = window.OSMBuildings = function(map) { + this.onAdd(map); +}; + +var proto = osmb.prototype = new google.maps.OverlayView(); + +proto.onAdd = function(map) { + this.map = map; + +// MapPanes.mapPane +// MapPanes.overlayLayer +// MapPanes.overlayShadow +// MapPanes.overlayImage +// MapPanes.floatShadow +// MapPanes.overlayMouseTarget +// MapPanes.floatPane + + var panes = this.getPanes(); + + this.container.appendTo(panes.overlayLayer); +// MAX_ZOOM = this.map._layersMaxZoom; + + var bounds = this.map.getBounds(); + var projection = this.getProjection(); + var sw = projection.fromLatLngToDivPixel(bounds.getSouthWest()); + var ne = projection.fromLatLngToDivPixel(bounds.getNorthEast()); + var w = ne.x-sw.x; + var h = sw.y-ne.y; + +// this.setMapState(); + + setZoom(this.map.zoom); + var pxOrigin = geoToPixel(bounds.getNorthEast().lat(), bounds.getSouthWest().lng()); +// setOrigin(pxOrigin.x, pxOrigin.y); + setCamOffset(0, 0); + + this.container.style.width = w + 'px'; + this.container.style.height = h + 'px'; + this.container.style.left = sw.x + 'px'; + this.container.style.top = ne.y + 'px'; + + this.map.addListener('drag', this.onMove.bind(this)); + this.map.addListener('dragend', this.onMoveEnd.bind(this)); + this.map.addListener('zoom_changed', this.onZoomEnd.bind(this)); + +// this.map.attributionControl.addAttribution(OSMBuildings.ATTRIBUTION); + + Data.update(); + Buildings.render(); // in case of for re-adding this layer +}; + +proto.onRemove = function() { +// this.map.attributionControl.removeAttribution(OSMBuildings.ATTRIBUTION); +// this.map.removeListener('drag', this.onMove); +// this.map.removeListener('dragend', this.onMoveEnd); +// this.map.removeListener('zoom_changed', this.onZoomEnd); + + this.container.remove(); + this.map = null; +}; + +proto.draw = function() {}; + +proto.onMove = function() { + setCamOffset(0, 0); + Buildings.render(); +}; + +proto.onMoveEnd = function() { + var bounds = this.map.getBounds(); + var pxOrigin = geoToPixel(bounds.getNorthEast().lat(), bounds.getSouthWest().lng()); +// setOrigin(pxOrigin.x, pxOrigin.y); + setCamOffset(0, 0); +// this.setMapState(); + onMoveEnd(); +}; + +proto.onZoomStart = function() { + onZoomStart(); +}; + +proto.onZoomEnd = function() { + onZoomEnd({ zoom: this.map.zoom }); + var bounds = this.map.getBounds(); + var pxOrigin = geoToPixel(bounds.getNorthEast().lat(), bounds.getSouthWest().lng()); +// setOrigin(pxOrigin.x, pxOrigin.y); +// this.setMapState(); +}; + + +proto.setMapState = function() { +// var map = this.map, +// pos = map.getPixelOrigin(), +// off = this.getContainerOffset(), +// size = map._size; +// setMapState({ w:size.x, h:size.y }, pos, off); +// this.offset = off; +}; \ No newline at end of file diff --git a/src/variables.js b/src/variables.js index 7f6eddf..a0f478c 100644 --- a/src/variables.js +++ b/src/variables.js @@ -2,7 +2,6 @@ var WIDTH = 0, HEIGHT = 0, // though this looks like a constant it's needed for distinguishing from local vars CENTER_X = 0, CENTER_Y = 0, - MARGIN = 200, originX = 0, originY = 0, zoom, size,