diff --git a/types/esri-leaflet-geocoder/index.d.ts b/types/esri-leaflet-geocoder/index.d.ts index 762af94558..59040f5458 100644 --- a/types/esri-leaflet-geocoder/index.d.ts +++ b/types/esri-leaflet-geocoder/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.4 import * as leaflet from 'leaflet'; -import { esri as esriLeaflet } from 'esri-leaflet'; +import * as esriLeaflet from 'esri-leaflet'; export = L; diff --git a/types/esri-leaflet/esri-leaflet-tests.ts b/types/esri-leaflet/esri-leaflet-tests.ts index f6dfdf6e30..d0f1249232 100644 --- a/types/esri-leaflet/esri-leaflet-tests.ts +++ b/types/esri-leaflet/esri-leaflet-tests.ts @@ -4,11 +4,14 @@ // tslint:disable:only-arrow-functions // tslint:disable:space-before-function-paren -import L = require('esri-leaflet'); +let latlng: L.LatLng = new L.LatLng(0, 0); +let latlngbounds: L.LatLngBounds = new L.LatLngBounds(latlng, latlng); +let map: L.Map = new L.Map('map'); -const latlng: L.LatLng = new L.LatLng(0, 0); -const latlngbounds: L.LatLngBounds = new L.LatLngBounds(latlng, latlng); -const map: L.Map = new L.Map('map'); +let marker: L.Marker = new L.Marker(latlng); +let polygon: L.Polygon = new L.Polygon([latlng, latlng]); +let polyline: L.Polyline = new L.Polyline([latlng, latlng]); +let geojson: L.GeoJSON = new L.GeoJSON(); let basemapLayer: L.esri.BasemapLayer; basemapLayer = L.esri.basemapLayer('Streets'); @@ -130,6 +133,7 @@ dynamicMapLayerOptions = { position: 'front', maxZoom: 1, minZoom: 1, + disableCache: true, dynamicLayers: [{ id: 501, source: { @@ -164,6 +168,7 @@ dynamicMapLayer = L.esri.dynamicMapLayer({ position: 'front', maxZoom: 1, minZoom: 1, + disableCache: true, dynamicLayers: [{ id: 501, source: { @@ -198,6 +203,7 @@ dynamicMapLayer = new L.esri.DynamicMapLayer({ position: 'front', maxZoom: 1, minZoom: 1, + disableCache: true, dynamicLayers: [{ id: 501, source: { @@ -525,6 +531,12 @@ query.ids(function (error, ids, response) { }); query.where("zone_id='B'").bounds(function (error, latLngBounds, response) { }); +query.transform(15851); +query.transform({wkid: 15851 }); +query.transform({wkt: "GEOGTRAN[\..."}); + +query.format(false); + let identifyFeaturesOptions: L.esri.IdentifyFeaturesOptions; let identifyFeatures: L.esri.IdentifyFeatures; @@ -561,6 +573,12 @@ identifyFeatures .layers('visible:1') .run(function (error, featureCollection, response) { }); +identifyFeatures.at(marker); +identifyFeatures.at(polygon); +identifyFeatures.at(polyline); +identifyFeatures.at(latlngbounds); +identifyFeatures.at(geojson); + let findOptions: L.esri.FindOptions; let find: L.esri.Find; diff --git a/types/esri-leaflet/index.d.ts b/types/esri-leaflet/index.d.ts index 31a31bb9b5..a79322983e 100644 --- a/types/esri-leaflet/index.d.ts +++ b/types/esri-leaflet/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for esri-leaflet 2.0 +// Type definitions for esri-leaflet 2.1 // Project: http://esri.github.io/esri-leaflet // Definitions by: strajuser // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -59,9 +59,15 @@ declare namespace L { | 'ShadedReliefLabels' | 'TerrainLabels'; - type LeafletGeometry = L.Marker | L.Polygon | L.Polyline | L.LatLng | L.LatLngBounds | L.GeoJSON; + type LeafletGeometry = L.Marker | L.Polygon | L.Polyline | L.LatLngExpression | L.LatLngBounds | L.GeoJSON; type GeoJSONGeometry = GeoJSON.Point | GeoJSON.Polygon | GeoJSON.LineString; type Geometry = LeafletGeometry | GeoJSONGeometry; + type SpatialReferenceExpression = number | SpatialReference; + + interface SpatialReference { + wkid?: number; + wkt?: string; + } /** * Options for L.esri.BasemapLayer @@ -339,6 +345,13 @@ declare namespace L { * @memberof DynamicMapLayerOptions */ dynamicLayers?: any; + /** + * If enabled, appends a timestamp to each request to ensure a fresh image is created server-side. + * + * @type {boolean} + * @memberof DynamicMapLayerOptions + */ + disableCache?: boolean; } /** @@ -995,6 +1008,15 @@ declare namespace L { * @memberof Task */ token(token: string): this; + + /** + * + * + * @param {boolean} returnUnformattedValues + * @returns {this} + * @memberof Task + */ + format(returnUnformattedValues: boolean): this; } /** @@ -1163,7 +1185,7 @@ declare namespace L { */ intersects(geometry: Geometry): this; /** - * Queries features from the service that have a bounding box that intersects the bounding box of the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. + * Queries features from the service that have a bounding box that intersects the bounding box of the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. * * @param {Geometry} geometry * @returns {this} @@ -1327,6 +1349,14 @@ declare namespace L { * @memberof Query */ bounds(callback: FeatureCallbackHandler, context?: any): this; + /** + * The WKID of a datum transformation for the server to apply when reprojecting output features. + * + * @param {SpatialReferenceExpression} datumTranformation + * @returns {this} + * @memberof Query + */ + transform(datumTranformation: SpatialReferenceExpression): this; } /** @@ -1363,13 +1393,13 @@ declare namespace L { */ on(map: L.Map): this; /** - * Identifies feautres at a given + * Identifies features at a given LatLng geometry can also be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLngBounds, L.GeoJSON or a valid GeoJSON object literal. * - * @param {LatLngExpression} latlng + * @param {Geometry} geometry * @returns {this} * @memberof IdentifyFeatures */ - at(latlng: LatLngExpression): this; + at(geometry: Geometry): this; /** * Add a layer definition to the query. * @@ -1593,5 +1623,5 @@ declare namespace L { } declare module 'esri-leaflet' { - export = L; + export = L.esri; }