Browse Source

build: Update generated files

master
Chimo 6 years ago
parent
commit
bbb082126c
3 changed files with 15 additions and 8 deletions
  1. +1
    -1
      chiq.js
  2. +1
    -1
      chiq.map.js
  3. +13
    -6
      chiq.unmin.js

+ 1
- 1
chiq.js View File

@ -1,4 +1,4 @@
!function(){"use strict";var e,t,n=window.Pullet||{};n.map={create:function(e,n){var o,r=t(n),a=new ol.layer.Tile({source:new ol.source.OSM}),i=[a,r],s=r.getSource().getExtent();return o=new ol.Map({target:e,layers:i,view:new ol.View({center:[0,0],zoom:1})}),o.getView().fit(s,o.getSize(),{maxZoom:18}),o}},t=function(t){var n,o,r,a,i,s=t.length,u=[];for(n=0;s>n;n+=1)a=t[n],i=a.tags.name,o=parseFloat(a.lat),r=parseFloat(a.lon),isNaN(o)||isNaN(r)||u.push(new ol.Feature({geometry:new ol.geom.Point(ol.proj.transform([r,o],"EPSG:4326","EPSG:3857"))}));return new ol.layer.Vector({source:new ol.source.Vector({features:u}),style:e((Pullet.paths.images||"")+"marker-green.png")})},e=function(e){return new ol.style.Style({image:new ol.style.Icon({anchor:[.5,46],anchorXUnits:"fraction",anchorYUnits:"pixels",opacity:.75,src:e})})},window.Pullet=n}(),function(){"use strict";var e,t=window.Pullet||{};t.nominatim={lookup:function(t){var n,o,r,a=window.Pullet.endpoint.nominatim+"/lookup",i=t.length,s=[],u=[],l=0,c=[],y=t.slice();return r=function(t){var n,o,r,a,s;if(l+=1,l===i){for(o=c.length,n=0;o>n;n+=1)r=c[n],a=e(r.osm_id,y),a!==!1&&(s=y[a],s.fill(r),y[a]=s);t(y)}},new Promise(function(e){for(Array.isArray(t)&&0!==t.length||e([]);t.length>0;){for(u=[],o=t.splice(0,50),i=o.length,n=0;i>n;n+=1)u.push(o[n].fid);s.push(u)}for(n=0,i=s.length;i>n;n+=1)xr.get(a,{format:"json",osm_ids:s[n].join()}).then(function(t){c=c.concat(t),r(e)}).catch(function(){r(e)})})}},e=function(e,t){var n,o,r=t.length;for(n=0;r>n;n+=1)if(o=t[n],o.osm_id===parseInt(e,10))return n;return!1},window.Pullet=t}(),function(){"use strict";var e,t=window.Pullet||{};e=function(e){this.osm_id=e.id,this.name=e.name,this.tags=e.tags,this.lat=e.lat,this.lon=e.lon,this.osm_type=e.type,this.fid=e.type.slice(0,1).toUpperCase()+e.id},e.prototype.fill=function(e){this.address=e.address,this.class=e.class,this.name||(this.name=e.display_name),this.display_name=e.display_name,this.lat=e.lat,this.lon=e.lon,this.nom_id=e.place_id,this.nom_type=e.type},t.Place=e,window.Pullet=t}(),function(){"use strict";var e,t,n=window.Pullet||{};n.places={nearby:function(){return Pullet.getLocation().then(function(e){var t=e.coords;return Pullet.places.near(t.latitude,t.longitude)}).catch(function(e){return Promise.reject(e)})},near:function(e,t){var n,o=Pullet.endpoint.overpass,r=300,a="<around lon='"+t+"' lat='"+e+"' radius='"+r+"'/>",i="<has-kv k='name'/>";return n="<osm-script output='json' timeout='25'><union><query type='node'><has-kv k='amenity'/>"+a+i+"</query><query type='way'><has-kv k='amenity'/>"+a+i+"</query><query type='node'><has-kv k='shop'/>"+a+i+"</query><query type='way'><has-kv k='shop'/>"+a+i+"</query><query type='node'><has-kv k='office'/>"+a+i+"</query><query type='way'><has-kv k='office'/>"+a+i+"</query><query type='node'><has-kv k='craft'/>"+a+i+"</query><query type='way'><has-kv k='craft'/>"+a+i+"</query><query type='node'><has-kv k='leisure'/>"+a+i+"</query><query type='way'><has-kv k='leisure'/>"+a+i+"</query><query type='node'><has-kv k='public_transport' v='platform'/>"+a+i+"</query><query type='way'><has-kv k='public_transport' v='platform'/>"+a+i+"</query><query type='node'><has-kv k='highway' v='bus_stop'/>"+a+i+"</query><query type='way'><has-kv k='highway' v='bus_stop'/>"+a+i+"</query></union><print mode='body' order='quadtile'/></osm-script>",xr.post(o,n).then(function(e){var t,n=e.elements,o=n.length,r=[];for(t=0;o>t;t+=1)r.push(new Pullet.Place(n[t]));return r})},fillDistance:function(e,t){var n,o,r,a=t.length,i=new LatLon(e.lat,e.lon);for(n=0;a>n;n+=1)o=t[n],r=new LatLon(o.lat,o.lon),t[n].distance=i.distanceTo(r);return t},sortByAlpha:function(t){return t.sort(e)},sortByDistance:function(e,o){return o=n.places.fillDistance(e,o),o.sort(t)}},t=function(e,t){var n=e.distance,o=t.distance;return o>n?-1:n>o?1:0},e=function(e,t){var n=e.tags.name||"",o=t.tags.name||"";return n=n.toLowerCase(),o=o.toLowerCase(),o>n?-1:n>o?1:0},window.Pullet=n}(),function(){"use strict";var e=window.Pullet||{};e.getLocation=function(){return new Promise(function(e,t){navigator.geolocation.getCurrentPosition(function(t){e(t)},function(e){t(e)})})},window.Pullet=e}();
!function(){"use strict";var e,t,n=window.Pullet||{};n.map={create:function(e,n){var o,r=t(n),a=new ol.layer.Tile({source:new ol.source.OSM}),i=[a,r],s=r.getSource().getExtent();return o=new ol.Map({target:e,layers:i,view:new ol.View({center:[0,0],zoom:1})}),o.getView().fit(s,o.getSize(),{maxZoom:18}),o}},t=function(t){var n,o,r,a,i,s=t.length,u=[];for(n=0;s>n;n+=1)a=t[n],i=a.tags.name,o=parseFloat(a.lat),r=parseFloat(a.lon),isNaN(o)||isNaN(r)||u.push(new ol.Feature({geometry:new ol.geom.Point(ol.proj.transform([r,o],"EPSG:4326","EPSG:3857")),name:i,osm_id:a.osm_id}));return new ol.layer.Vector({source:new ol.source.Vector({features:u}),style:e((Pullet.paths.images||"")+"marker-green.png")})},e=function(e){return new ol.style.Style({image:new ol.style.Icon({anchor:[.5,46],anchorXUnits:"fraction",anchorYUnits:"pixels",opacity:.75,src:e})})},window.Pullet=n}(),function(){"use strict";var e,t=window.Pullet||{};t.nominatim={lookup:function(t){var n,o,r,a=window.Pullet.endpoint.nominatim+"/lookup",i=t.length,s=[],u=[],l=0,c=[],y=t.slice();return r=function(t){var n,o,r,a,s;if(l+=1,l===i){for(o=c.length,n=0;o>n;n+=1)r=c[n],a=e(r.osm_id,y),a!==!1&&(s=y[a],s.fill(r),y[a]=s);t(y)}},new Promise(function(e){for(Array.isArray(t)&&0!==t.length||e([]);t.length>0;){for(u=[],o=t.splice(0,50),i=o.length,n=0;i>n;n+=1)u.push(o[n].fid);s.push(u)}for(n=0,i=s.length;i>n;n+=1)xr.get(a,{format:"json",osm_ids:s[n].join()}).then(function(t){c=c.concat(t),r(e)}).catch(function(){r(e)})})}},e=function(e,t){var n,o,r=t.length;for(n=0;r>n;n+=1)if(o=t[n],o.osm_id===parseInt(e,10))return n;return!1},window.Pullet=t}(),function(){"use strict";var e,t=window.Pullet||{};e=function(e){this.osm_id=e.id,this.tags=e.tags,this.lat=e.lat,this.lon=e.lon,this.osm_type=e.type,this.name=e.tags&&e.tags.name?e.tags.name:e.name||"",this.fid=e.type.slice(0,1).toUpperCase()+e.id},e.prototype.fill=function(e){this.address=e.address,this.class=e.class,this.name||(this.name=e.display_name),this.display_name=e.display_name,this.lat=e.lat,this.lon=e.lon,this.nom_id=e.place_id,this.nom_type=e.type},t.Place=e,window.Pullet=t}(),function(){"use strict";var e,t,n=window.Pullet||{};n.places={nearby:function(){return Pullet.getLocation().then(function(e){var t=e.coords;return Pullet.places.near(t.latitude,t.longitude)}).catch(function(e){return Promise.reject(e)})},near:function(e,t){var n,o=Pullet.endpoint.overpass,r=300,a="<around lon='"+t+"' lat='"+e+"' radius='"+r+"'/>",i="<has-kv k='name'/>";return n="<osm-script output='json' timeout='25'><union><query type='node'><has-kv k='amenity'/>"+a+i+"</query><query type='way'><has-kv k='amenity'/>"+a+i+"</query><query type='node'><has-kv k='shop'/>"+a+i+"</query><query type='way'><has-kv k='shop'/>"+a+i+"</query><query type='node'><has-kv k='office'/>"+a+i+"</query><query type='way'><has-kv k='office'/>"+a+i+"</query><query type='node'><has-kv k='craft'/>"+a+i+"</query><query type='way'><has-kv k='craft'/>"+a+i+"</query><query type='node'><has-kv k='leisure'/>"+a+i+"</query><query type='way'><has-kv k='leisure'/>"+a+i+"</query><query type='node'><has-kv k='public_transport' v='platform'/>"+a+i+"</query><query type='way'><has-kv k='public_transport' v='platform'/>"+a+i+"</query><query type='node'><has-kv k='highway' v='bus_stop'/>"+a+i+"</query><query type='way'><has-kv k='highway' v='bus_stop'/>"+a+i+"</query></union><print mode='body' order='quadtile'/></osm-script>",xr.post(o,n).then(function(e){var t,n=e.elements,o=n.length,r=[];for(t=0;o>t;t+=1)r.push(new Pullet.Place(n[t]));return r})},fillDistance:function(e,t){var n,o,r,a=t.length,i=new LatLon(e.lat,e.lon);for(n=0;a>n;n+=1)o=t[n],r=new LatLon(o.lat,o.lon),t[n].distance=i.distanceTo(r);return t},sortByAlpha:function(t){return t.sort(e)},sortByDistance:function(e,o){return o=n.places.fillDistance(e,o),o.sort(t)}},t=function(e,t){var n=e.distance,o=t.distance;return o>n?-1:n>o?1:0},e=function(e,t){var n=e.tags.name||"",o=t.tags.name||"";return n=n.toLowerCase(),o=o.toLowerCase(),o>n?-1:n>o?1:0},window.Pullet=n}(),function(){"use strict";var e=window.Pullet||{};e.getLocation=function(){return new Promise(function(e,t){navigator.geolocation.getCurrentPosition(function(t){e(t)},function(e){t(e)})})},window.Pullet=e}();
//# sourceMappingURL=chiq.map.js
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */


+ 1
- 1
chiq.map.js
File diff suppressed because it is too large
View File


+ 13
- 6
chiq.unmin.js View File

@ -240,7 +240,7 @@ if (Number.prototype.toRadians === undefined) {
module.exports = xr;
});
( function() {
/*global ol: false*/
/*global ol: false, Pullet: false*/
"use strict";
var _Pullet = window.Pullet || {},
@ -300,15 +300,17 @@ if (Number.prototype.toRadians === undefined) {
continue;
}
// create markers
// Create markers
markers.push(
new ol.Feature( {
geometry: new ol.geom.Point( ol.proj.transform( [ lon, lat ], "EPSG:4326", "EPSG:3857" ) )
geometry: new ol.geom.Point( ol.proj.transform( [ lon, lat ], "EPSG:4326", "EPSG:3857" ) ),
name: poiName,
osm_id: point.osm_id
} )
);
}
// create and return layer
// Create and return layer
return new ol.layer.Vector( {
source: new ol.source.Vector( { features: markers } ),
style: createStyle( ( Pullet.paths.images || "" ) + "marker-green.png" )
@ -330,7 +332,7 @@ if (Number.prototype.toRadians === undefined) {
anchorYUnits: "pixels",
opacity: 0.75,
src: src
}
}
)
}
);
@ -458,12 +460,17 @@ if (Number.prototype.toRadians === undefined) {
_Place = function( obj ) {
/* Copy Overpass info */
this.osm_id = obj.id;
this.name = obj.name;
this.tags = obj.tags;
this.lat = obj.lat;
this.lon = obj.lon;
this.osm_type = obj.type;
if ( obj.tags && obj.tags.name ) {
this.name = obj.tags.name;
} else {
this.name = obj.name || "";
}
// Add ID required by nominatim
this.fid = obj.type.slice( 0, 1 ).toUpperCase() + obj.id;
};


Loading…
Cancel
Save