diff --git a/README.md b/README.md
index 0aab581..adcf19c 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ map web page for plotting "things" on.
![Map Image](https://dceejay.github.io/pages/images/redmap.png)
-### Changes
+ - v1.0.20 - Add buildings overlay.
- v1.0.19 - Add circle mode - specify name, lat, lon and radius.
- v1.0.18 - Correct .photourl property to match .photoUrl as per docs
- v1.0.17 - Removed Mapquest maps. Bug fixes - reduced leakage of listeners being added.
diff --git a/package.json b/package.json
index 0714c6e..787d0dd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name" : "node-red-contrib-web-worldmap",
- "version" : "1.0.19",
+ "version" : "1.0.20",
"description" : "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies" : {
"express": "4.*",
diff --git a/worldmap/index.html b/worldmap/index.html
index f24e3da..a01277e 100644
--- a/worldmap/index.html
+++ b/worldmap/index.html
@@ -52,6 +52,7 @@
+
@@ -653,6 +654,9 @@ overlays["pressure"] = L.tileLayer('http://{s}.tile.openweathermap.org/map/press
overlays["weather"] = L.OWM.current({interval:30, minZoom:8, appId:"9ae11d4f6f9bed61f32fc061f715cc71"});
+overlays["buildings"] = new OSMBuildings(map).load();
+map.removeLayer(overlays["buildings"]);
+
// Add the shipping navigation markers
//var OpenSeaMap = L.tileLayer('http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png', {
// attribution: 'Map data: © OpenSeaMap contributors'
diff --git a/worldmap/leaflet/OSMBuildings-Leaflet.js b/worldmap/leaflet/OSMBuildings-Leaflet.js
new file mode 100644
index 0000000..904e0a5
--- /dev/null
+++ b/worldmap/leaflet/OSMBuildings-Leaflet.js
@@ -0,0 +1,48 @@
+(function(ca){function S(b,a){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d}function va(b){var a=b.length;if(16>a)return!1;var c,d=Infinity,f=-Infinity,e=Infinity,g=-Infinity;for(c=0;cf||1.15g/e||1.2=a?90:1<=a?-90:(2*xa(ya(E*
+(1-2*a)))-J)/E*180;c[d]=f;c[za]=360*(1===b?1:(b%1+1)%1)-180;return c}function da(b,a){var c=U(1,K(0,0.5-Aa(ka(Ba+J*b/180))/E/2));return{x:(a/360+0.5)*T<<0,y:c*T<<0}}function V(b){for(var a=B+p,c=v+n,d=0,f=b.length-3;dp&&b[d]n&&b[d+1]b[c].scale&&(b[c].scale+=0.1,1c&&(c+=1);1c?b:c<2/3?a+(b-a)*(2/3-c)*6:a}var c={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",grey:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},d=function(a,b,
+c,d){this.H=a;this.S=b;this.L=c;this.A=d};d.parse=function(a){var b=0,d=0,h=0,k=1,m;a=(""+a).toLowerCase();a=c[a]||a;if(m=a.match(/^#(\w{2})(\w{2})(\w{2})$/))b=parseInt(m[1],16),d=parseInt(m[2],16),h=parseInt(m[3],16);else if(m=a.match(/rgba?\((\d+)\D+(\d+)\D+(\d+)(\D+([\d.]+))?\)/))b=parseInt(m[1],10),d=parseInt(m[2],10),h=parseInt(m[3],10),k=m[4]?parseFloat(m[5]):1;else return;return this.fromRGBA(b,d,h,k)};d.fromRGBA=function(a,b,c,h){"object"===typeof a?(b=a.g/255,c=a.b/255,h=a.a,a=a.r/255):(a/=
+255,b/=255,c/=255);var k=Math.max(a,b,c),m=Math.min(a,b,c),l,y=(k+m)/2,s=k-m;if(s){m=0.5d?d*(1+c):d+c-d*c,d=2*d-m,b=b/360,c=a(d,m,b+1/3);k=a(d,m,b);b=
+a(d,m,b-1/3)}return{r:Math.round(255*c),g:Math.round(255*k),b:Math.round(255*b),a:h}},toString:function(){var a=this.toRGBA();return 1===a.a?"#"+(16777216+(a.r<<16)+(a.g<<8)+a.b).toString(16).slice(1,7):"rgba("+[a.r,a.g,a.b,a.a.toFixed(2)].join()+")"},hue:function(a){return new d(this.H*a,this.S,this.L,this.A)},saturation:function(a){return new d(this.H,this.S*a,this.L,this.A)},lightness:function(a){return new d(this.H,this.S,this.L*a,this.A)},alpha:function(a){return new d(this.H,this.S,this.L,this.A*
+a)}};return d}(this),Ha=function(){var b=Math,a=b.PI,c=b.sin,d=b.cos,f=b.tan,e=b.asin,g=b.atan2,h=a/180,k=23.4397*h;return function(b,l,y){y=h*-y;l*=h;b=b.valueOf()/864E5-0.5+2440588-2451545;var s=h*(357.5291+0.98560028*b),D;D=h*(1.9148*c(s)+0.02*c(2*s)+3E-4*c(3*s));D=s+D+102.9372*h+a;s=e(c(0)*d(k)+d(0)*c(k)*c(D));D=g(c(D)*d(k)-f(0)*c(k),d(D));b=h*(280.16+360.9856235*b)-y-D;y=e(c(l)*c(s)+d(l)*d(s)*d(b));l=g(c(b),d(b)*c(l)-f(s)*d(l));return{altitude:y,azimuth:l-a/2}}}(),Ja=function(){function b(a){a=
+a.toLowerCase();return"#"===a[0]?a:d[f[a]||a]||null}function a(a,b){var c,d,f,s,D=0,p,n;p=0;for(n=a.length-3;ph.status||299f;)k=c.shift(),d-=k.size,delete a[k.url]}};h.open("GET",b);h.send(null);return h}}var a={},c=[],d=0,f=5242880;return{loadJSON:function(a,c){return b(a,function(a){var b;try{b=
+JSON.parse(a)}catch(d){}c(b)})}}}(),F={loadedItems:{},items:[],getPixelFootprint:function(b){for(var a=new ra(b.length),c,d=0,f=b.length-1;dg&&(k=e,g=h)}2a.length))return a},resetItems:function(){this.items=[];this.loadedItems={};Y.reset()},addRenderItems:function(b,a){for(var c,d,f,e=Ja.read(b),g=0,h=e.length;gga)&&(a.footprint=this.getPixelFootprint(b.footprint),a.footprint)){for(var d=a.footprint,f=Infinity,e=-Infinity,g=Infinity,h=-Infinity,k=0,m=d.length-3;k>16-x,c=p/a<<0,
+d=n/a<<0,f=qa((p+B)/a),a=qa((n+v)/a),e,g=this;for(e=d;e<=a;e++)for(d=c;d<=f;d++)this.loadTile(d,e,16,b)}},loadTile:function(b,a,c,d){b=this.src.replace("{s}","abcd"[(b+a)%4]).replace("{x}",b).replace("{y}",a).replace("{z}",c);return Ka.loadJSON(b,d)}},Z={draw:function(b,a,c,d,f,e,g,h){var k,m=this._extrude(b,a,d,f,e,g),l=[];if(c)for(a=0,k=c.length;a(m.x-h.x)*(k.y-h.y)&&(b.fillStyle=h.xk.x&&h.y>k.y?e:f,b.beginPath(),this._ring(b,[k.x,k.y,h.x,h.y,m.x,m.y,l.x,l.y]),b.closePath(),b.fill()),y[s]=m.x,y[s+1]=m.y;return y},_ring:function(b,a){b.moveTo(a[0],
+a[1]);for(var c=2,d=a.length-1;c(k.x-g.x)*(h.y-g.y)?(1===e&&b.lineTo(g.x,g.y),e=0,l||b.moveTo(g.x,g.y),b.lineTo(h.x,h.y)):(0===e&&b.lineTo(k.x,k.y),e=1,l||b.moveTo(k.x,k.y),b.lineTo(m.x,m.y));if(c)for(l=0,q=c.length;l(e.x-g.x)*(h.y-g.y)?(1===c&&b.lineTo(g.x,g.y),c=0,l||b.moveTo(g.x,g.y),b.lineTo(h.x,h.y)):(0===c&&b.lineTo(e.x,e.y),c=1,l||b.moveTo(e.x,e.y),b.lineTo(m.x,m.y));b.closePath();b.fill()}},w={draw:function(b,a,c,d,f,e,g,h,k){a={x:a.x-p,y:a.y-n};var m=q/(q-f),l=q/(q-e);f=r.project(a,m);d*=m;e&&(a=r.project(a,l),c*=l);(m=this._tangents(a,
+c,f,d))?(e=P(m[0].y1-a.y,m[0].x1-a.x),m=P(m[1].y1-a.y,m[1].x1-a.x)):(e=1.5*E,m=1.5*E);b.fillStyle=g;b.beginPath();b.arc(f.x,f.y,d,J,e,!0);b.arc(a.x,a.y,c,e,J);b.closePath();b.fill();b.fillStyle=h;b.beginPath();b.arc(f.x,f.y,d,m,J,!0);b.arc(a.x,a.y,c,J,m);b.closePath();b.fill();b.fillStyle=k;this._circle(b,f,d)},simplified:function(b,a,c){this._circle(b,{x:a.x-p,y:a.y-n},c)},shadow:function(b,a,c,d,f,e){a={x:a.x-p,y:a.y-n};f=z.project(a,f);var g;e&&(a=z.project(a,e));var h=this._tangents(a,c,f,d);
+h?(e=P(h[0].y1-a.y,h[0].x1-a.x),g=P(h[1].y1-a.y,h[1].x1-a.x),b.moveTo(h[1].x2,h[1].y2),b.arc(f.x,f.y,d,g,e),b.arc(a.x,a.y,c,e,g)):(b.moveTo(a.x+c,a.y),b.arc(a.x,a.y,c,0,2*E))},shadowMask:function(b,a,c){var d=a.x-p;a=a.y-n;b.moveTo(d+c,a);b.arc(d,a,c,0,2*E)},hitArea:function(b,a,c,d,f,e,g){a={x:a.x-p,y:a.y-n};var h=q/(q-f),k=q/(q-e);f=r.project(a,h);d*=h;e&&(a=r.project(a,k),c*=k);e=this._tangents(a,c,f,d);b.fillStyle=g;b.beginPath();e?(g=P(e[0].y1-a.y,e[0].x1-a.x),h=P(e[1].y1-a.y,e[1].x1-a.x),b.moveTo(e[1].x2,
+e[1].y2),b.arc(f.x,f.y,d,h,g),b.arc(a.x,a.y,c,g,h)):(b.moveTo(a.x+c,a.y),b.arc(a.x,a.y,c,0,2*E));b.closePath();b.fill()},_circle:function(b,a,c){b.beginPath();b.arc(a.x,a.y,c,0,2*E);b.stroke();b.fill()},_tangents:function(b,a,c,d){var f=b.x-c.x,e=b.y-c.y,g=a-d,h=f*f+e*e;if(!(h<=g*g)){var h=pa(h),f=-f/h,e=-e/h,g=g/h,h=[],k,m,l;k=pa(K(0,1-g*g));for(var n=1;-1<=n;n-=2)m=f*g-n*k*e,l=e*g+n*k*f,h.push({x1:b.x+a*m<<0,y1:b.y+a*l<<0,x2:c.x+d*m<<0,y2:c.y+d*l<<0});return h}}},R={draw:function(b,a,c,d,f,e,g){var h=
+q/(q-f);c=r.project({x:c.x-p,y:c.y-n},q/(q-d));d={x:0,y:0};for(var k={x:0,y:0},m=0,l=a.length-3;m(c.x-d.x)*(k.y-d.y)&&(b.fillStyle=d.xk.x&&d.y>k.y?g:e,b.beginPath(),this._triangle(b,d,k,c),b.closePath(),b.fill())},_triangle:function(b,a,c,d){b.moveTo(a.x,a.y);b.lineTo(c.x,c.y);b.lineTo(d.x,d.y)},_ring:function(b,a){b.moveTo(a[0]-p,a[1]-n);for(var c=2,d=a.length-1;c<
+d;c+=2)b.lineTo(a[c]-p,a[c+1]-n)},shadow:function(b,a,c,d,f){var e={x:0,y:0},g={x:0,y:0};c=z.project({x:c.x-p,y:c.y-n},d);d=0;for(var h=a.length-3;d(c.x-e.x)*(g.y-e.y)&&this._triangle(b,e,g,c)},shadowMask:function(b,a){this._ring(b,a)},hitArea:function(b,a,c,d,f,e){var g=q/(q-f);c=r.project({x:c.x-p,y:c.y-n},q/(q-d));d={x:0,y:0};var h={x:0,y:0};b.fillStyle=e;b.beginPath();e=0;for(var k=
+a.length-3;e(c.x-d.x)*(h.y-d.y)&&this._triangle(b,d,h,c);b.closePath();b.fill()}},r={project:function(b,a){return{x:(b.x-M)*a+M<<0,y:(b.y-N)*a+N<<0}},render:function(){var b=this.context;b.clearRect(0,0,B,v);if(!(xa.scale?a.height*a.scale:a.height;d=0;a.minHeight&&(d=1>a.scale?a.minHeight*a.scale:a.minHeight);g=a.wallColor||ha;h=a.altColor||aa;k=a.roofColor||X;b.strokeStyle=h;switch(a.shape){case "cylinder":w.draw(b,a.center,a.radius,a.radius,c,d,g,h,k);break;case "cone":w.draw(b,a.center,a.radius,0,c,d,g,h);break;case "dome":w.draw(b,a.center,a.radius,a.radius/2,c,d,g,h);break;case "sphere":w.draw(b,a.center,a.radius,a.radius,c,d,g,h,k);break;case "pyramid":R.draw(b,
+e,a.center,c,d,g,h);break;default:Z.draw(b,e,a.holes,c,d,g,h,k)}switch(a.roofShape){case "cone":w.draw(b,a.center,a.radius,0,c+a.roofHeight,c,k,""+I.parse(k).lightness(0.9));break;case "dome":w.draw(b,a.center,a.radius,a.radius/2,c+a.roofHeight,c,k,""+I.parse(k).lightness(0.9));break;case "pyramid":R.draw(b,e,a.center,c+a.roofHeight,c,k,I.parse(k).lightness(0.9))}}}}},ia={maxZoom:G+2,maxHeight:5,isSimple:function(b){return x<=this.maxZoom&&b.height+b.roofHeightthis.maxZoom))for(var a,c,d=F.items,f=0,e=d.length;f=this.maxHeight)&&(c=a.footprint,V(c)))switch(b.strokeStyle=a.altColor||aa,b.fillStyle=a.roofColor||X,a.shape){case "cylinder":case "cone":case "dome":case "sphere":w.simplified(b,a.center,a.radius);break;default:Z.simplified(b,c,a.holes)}}},z={enabled:!0,color:"#666666",blurColor:"#000000",blurSize:15,date:new Date,direction:{x:0,y:0},project:function(b,a){return{x:b.x+
+this.direction.x*a,y:b.y+this.direction.y*a}},render:function(){var b=this.context,a,c,d;b.clearRect(0,0,B,v);if(!(!this.enabled||x=a.altitude))){c=1/ka(a.altitude);d=5>c?0.75:1/c*5;this.direction.x=Fa(a.azimuth)*c;this.direction.y=Ea(a.azimuth)*c;var f,e,g,h;a=F.items;b.canvas.style.opacity=d/(2*C);b.shadowColor=this.blurColor;b.shadowBlur=C/2*this.blurSize;b.fillStyle=this.color;b.beginPath();d=0;for(c=a.length;df.scale?f.height*f.scale:f.height;g=0;f.minHeight&&(g=1>f.scale?f.minHeight*f.scale:f.minHeight);switch(f.shape){case "cylinder":w.shadow(b,f.center,f.radius,f.radius,e,g);break;case "cone":w.shadow(b,f.center,f.radius,0,e,g);break;case "dome":w.shadow(b,f.center,f.radius,f.radius/2,e,g);break;case "sphere":w.shadow(b,f.center,f.radius,f.radius,e,g);break;case "pyramid":R.shadow(b,h,f.center,e,g);break;default:Z.shadow(b,h,f.holes,e,g)}switch(f.roofShape){case "cone":w.shadow(b,
+f.center,f.radius,0,e+f.roofHeight,e);break;case "dome":w.shadow(b,f.center,f.radius,f.radius/2,e+f.roofHeight,e);break;case "pyramid":R.shadow(b,h,f.center,e+f.roofHeight,e)}}b.closePath();b.fill();b.shadowBlur=null;b.globalCompositeOperation="destination-out";b.beginPath();d=0;for(c=a.length;d>8&255,a>>16&255].join()+")"}},
+$,A={container:document.createElement("DIV"),items:[],init:function(){this.container.style.pointerEvents="none";this.container.style.position="absolute";this.container.style.left=0;this.container.style.top=0;z.context=this.createContext(this.container);ia.context=this.createContext(this.container);r.context=this.createContext(this.container);Y.context=this.createContext()},render:function(b){Ga(function(){b||(z.render(),ia.render(),Y.render());r.render()})},createContext:function(b){var a=document.createElement("CANVAS");
+a.style.transform="translate3d(0, 0, 0)";a.style.imageRendering="optimizeSpeed";a.style.position="absolute";a.style.left=0;a.style.top=0;var c=a.getContext("2d");c.lineCap="round";c.lineJoin="round";c.lineWidth=1;c.imageSmoothingEnabled=!1;this.items.push(a);b&&b.appendChild(a);return c},appendTo:function(b){b.appendChild(this.container)},remove:function(){this.container.parentNode.removeChild(this.container)},setSize:function(b,a){for(var c=0,d=this.items.length;cOSM Buildings
');F.update()};t.onRemove=function(){var b=this.map;b.attributionControl&&b.attributionControl.removeAttribution('© OSM Buildings');b.off({move:this.onMove,
+moveend:this.onMoveEnd,zoomstart:this.onZoomStart,zoomend:this.onZoomEnd,resize:this.onResize,viewreset:this.onViewReset,click:this.onClick},this);b.options.zoomAnimation&&b.off("zoomanim",this.onZoom,this);A.remove()};t.onMove=function(b){b=this.getOffset();ea({x:this.offset.x-b.x,y:this.offset.y-b.y})};t.onMoveEnd=function(b){if(this.noMoveEnd)this.noMoveEnd=!1;else{var a=this.map;b=this.getOffset();var c=a.getPixelOrigin();this.offset=b;A.setPosition(-b.x,-b.y);ea({x:0,y:0});la({width:a._size.x,
+height:a._size.y});a=c.y-b.y;p=c.x-b.x;n=a;A.render();F.update()}};t.onZoomStart=function(b){Q=!0;A.render()};t.onZoom=function(b){};t.onZoomEnd=function(b){b=this.map;var a=this.getOffset(),c=b.getPixelOrigin(),d=c.y-a.y;p=c.x-a.x;n=d;b=b._zoom;Q=!1;ma(b);F.update();A.render();this.noMoveEnd=!0};t.onResize=function(){};t.onViewReset=function(){var b=this.getOffset();this.offset=b;A.setPosition(-b.x,-b.y);ea({x:0,y:0})};t.onClick=function(b){var a=Y.getIdFromXY(b.containerPoint.x,b.containerPoint.y);
+a&&ua({feature:a,lat:b.latlng.lat,lon:b.latlng.lng})};t.getOffset=function(){return L.DomUtil.getPosition(this.map._mapPane)};t.style=function(b){b=b||{};var a;if(a=b.color||b.wallColor)H=I.parse(a),ha=""+H.alpha(C),ba=H.lightness(0.8),aa=""+ba.alpha(C),O=H.lightness(1.2),X=""+O.alpha(C);b.roofColor&&(O=I.parse(b.roofColor),X=""+O.alpha(C));void 0!==b.shadows&&(z.enabled=!!b.shadows);A.render();return this};t.date=function(b){z.date=b;z.render();return this};t.load=function(b){F.load(b);return this};
+t.set=function(b){F.set(b);return this};var ta=function(){};t.each=function(b){ta=function(a){return b(a)};return this};var ua=function(){};t.click=function(b){ua=function(a){return b(a)};return this};u.VERSION="0.2.2b";u.ATTRIBUTION='© OSM Buildings';ca.OSMBuildings=u})(this);
diff --git a/worldmap/worldmap.appcache b/worldmap/worldmap.appcache
index b5d139a..0ff293c 100644
--- a/worldmap/worldmap.appcache
+++ b/worldmap/worldmap.appcache
@@ -1,5 +1,5 @@
CACHE MANIFEST
-# date: Sep 11th v1.0.18
+# date: Oct 18th v1.0.20
CACHE:
index.html
@@ -39,6 +39,7 @@ leaflet/leaflet.markercluster.freezable-src.js
leaflet/leaflet.measurecontrol.css
leaflet/leaflet.measurecontrol.js
leaflet/leaflet.select-layers.min.js
+leaflet/OSMBuildings-Leaflet.js
leaflet/socket.io-1.4.5.js
leaflet/tile.stamen.js
leaflet/images/layers-2x.png