Merge pull request #18970 from strajuser/esri-leaflet

[esri-leaflet] v2.1
This commit is contained in:
Daniel Rosenwasser
2017-08-18 14:06:54 -07:00
committed by GitHub
3 changed files with 60 additions and 12 deletions
+1 -1
View File
@@ -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;
+22 -4
View File
@@ -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;
+37 -7
View File
@@ -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 <https://github.com/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;
}