You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{283:function(e,t,n){"use strict";n.r(t);var o=n(30),r=n(3),i=n(9),a=n(70),u=n(88),s=n(2),g=n(5),c=n(94),l=function(e,t){if(t.geometry){var n,o=t.type,r=t.geometry;return 1===o?(n="MultiPoint",1==r.length&&(n="Point",r=r[0])):2===o?(n="MultiLineString",1==r.length&&(n="LineString",r=r[0])):3===o&&(n="Polygon",r.length>1&&(n="MultiPolygon",r=[r])),{type:"Feature",geometry:{type:n,coordinates:r},properties:t.tags}}return t},w=new r.a({layers:[new g.a({source:new i.b})],target:"map",view:new s.a({center:[0,0],zoom:2})});fetch("data/geojson/countries.geojson").then((function(e){return e.json()})).then((function(e){var t=geojsonvt(e,{extent:4096,debug:1}),n=new o.a({dataProjection:new a.a({code:"TILE_PIXELS",units:"tile-pixels",extent:[0,0,4096,4096]})}),r=new u.a({tileUrlFunction:function(e){return JSON.stringify(e)},tileLoadFunction:function(e,o){var i=JSON.parse(o),a=t.getTile(i[0],i[1],i[2]),u=JSON.stringify({type:"FeatureCollection",features:a?a.features:[]},l),s=n.readFeatures(u,{extent:r.getTileGrid().getTileCoordExtent(i),featureProjection:w.getView().getProjection()});e.setFeatures(s)}}),i=new c.a({source:r});w.addLayer(i)}))}},[[283,0]]]);
|
|
//# sourceMappingURL=geojson-vt.js.map
|