kopia lustrzana https://github.com/robhawkes/vizicities
Added more robust method for only rendering GeoJSON geometry types that are supported
rodzic
a91ccae917
commit
0cc5d12459
|
@ -11704,6 +11704,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
features.forEach(function (feature) {
|
features.forEach(function (feature) {
|
||||||
// feature.geometry, feature.properties
|
// feature.geometry, feature.properties
|
||||||
|
|
||||||
|
// Skip features that aren't polygons
|
||||||
|
//
|
||||||
|
// TODO: Add support for all GeoJSON geometry types, including Multi...
|
||||||
|
// geometry types
|
||||||
|
if (feature.geometry.type !== 'Polygon') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get style object, if provided
|
// Get style object, if provided
|
||||||
if (typeof _this4._options.style === 'function') {
|
if (typeof _this4._options.style === 'function') {
|
||||||
style = _this4._options.style(feature);
|
style = _this4._options.style(feature);
|
||||||
|
@ -11711,16 +11719,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var coordinates = feature.geometry.coordinates;
|
var coordinates = feature.geometry.coordinates;
|
||||||
|
|
||||||
// Skip if geometry is a point
|
|
||||||
//
|
|
||||||
// This should be a user-defined filter as it would be wrong to assume
|
|
||||||
// that people won't want to output points
|
|
||||||
//
|
|
||||||
// The default use-case should be to output points in a different way
|
|
||||||
if (!coordinates[0] || !coordinates[0][0] || !Array.isArray(coordinates[0][0])) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
coordinates = coordinates.map(function (ring) {
|
coordinates = coordinates.map(function (ring) {
|
||||||
return ring.map(function (coordinate) {
|
return ring.map(function (coordinate) {
|
||||||
var latlon = (0, _geoLatLon2['default'])(coordinate[1], coordinate[0]);
|
var latlon = (0, _geoLatLon2['default'])(coordinate[1], coordinate[0]);
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -267,6 +267,14 @@ class GeoJSONTile extends Tile {
|
||||||
features.forEach(feature => {
|
features.forEach(feature => {
|
||||||
// feature.geometry, feature.properties
|
// feature.geometry, feature.properties
|
||||||
|
|
||||||
|
// Skip features that aren't polygons
|
||||||
|
//
|
||||||
|
// TODO: Add support for all GeoJSON geometry types, including Multi...
|
||||||
|
// geometry types
|
||||||
|
if (feature.geometry.type !== 'Polygon') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get style object, if provided
|
// Get style object, if provided
|
||||||
if (typeof this._options.style === 'function') {
|
if (typeof this._options.style === 'function') {
|
||||||
style = this._options.style(feature);
|
style = this._options.style(feature);
|
||||||
|
@ -274,16 +282,6 @@ class GeoJSONTile extends Tile {
|
||||||
|
|
||||||
var coordinates = feature.geometry.coordinates;
|
var coordinates = feature.geometry.coordinates;
|
||||||
|
|
||||||
// Skip if geometry is a point
|
|
||||||
//
|
|
||||||
// This should be a user-defined filter as it would be wrong to assume
|
|
||||||
// that people won't want to output points
|
|
||||||
//
|
|
||||||
// The default use-case should be to output points in a different way
|
|
||||||
if (!coordinates[0] || !coordinates[0][0] || !Array.isArray(coordinates[0][0])) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
coordinates = coordinates.map(ring => {
|
coordinates = coordinates.map(ring => {
|
||||||
return ring.map(coordinate => {
|
return ring.map(coordinate => {
|
||||||
var latlon = LatLon(coordinate[1], coordinate[0]);
|
var latlon = LatLon(coordinate[1], coordinate[0]);
|
||||||
|
|
Ładowanie…
Reference in New Issue