Update GeoJSON definition with generics

This commit is contained in:
Yukiya Nakagawa
2016-03-19 23:36:02 +09:00
parent 6766ed1d0f
commit 1d3dd1edee
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ var featureCollection: GeoJSON.FeatureCollection = {
}
}
var feature: GeoJSON.Feature = {
var feature: GeoJSON.Feature<GeoJSON.Polygon> = {
type: "Feature",
bbox: [-180.0, -90.0, 180.0, 90.0],
geometry: {
+4 -4
View File
@@ -90,9 +90,9 @@ declare namespace GeoJSON {
/***
* http://geojson.org/geojson-spec.html#feature-objects
*/
export interface Feature extends GeoJsonObject
export interface Feature<T extends GeometryObject> extends GeoJsonObject
{
geometry: GeometryObject;
geometry: T;
properties: any;
id?: string;
}
@@ -100,9 +100,9 @@ declare namespace GeoJSON {
/***
* http://geojson.org/geojson-spec.html#feature-collection-objects
*/
export interface FeatureCollection extends GeoJsonObject
export interface FeatureCollection<T extends GeometryObject> extends GeoJsonObject
{
features: Feature[];
features: Feature<T>[];
}
/***