- update to 2.1 api

This commit is contained in:
strajuser
2017-08-15 14:16:33 +03:00
parent 0eb683f995
commit 07b38388cb
2 changed files with 55 additions and 5 deletions
+20
View File
@@ -8,6 +8,11 @@ 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');
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');
basemapLayer = L.esri.basemapLayer('Topographic');
@@ -128,6 +133,7 @@ dynamicMapLayerOptions = {
position: 'front',
maxZoom: 1,
minZoom: 1,
disableCache: true,
dynamicLayers: [{
id: 501,
source: {
@@ -162,6 +168,7 @@ dynamicMapLayer = L.esri.dynamicMapLayer({
position: 'front',
maxZoom: 1,
minZoom: 1,
disableCache: true,
dynamicLayers: [{
id: 501,
source: {
@@ -196,6 +203,7 @@ dynamicMapLayer = new L.esri.DynamicMapLayer({
position: 'front',
maxZoom: 1,
minZoom: 1,
disableCache: true,
dynamicLayers: [{
id: 501,
source: {
@@ -523,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;
@@ -559,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;
+35 -5
View File
@@ -1,4 +1,4 @@
// Type definitions for esri-leaflet 2.0
// Type definitions for esri-leaflet 2.1.1
// Project: http://esri.github.io/esri-leaflet
// Definitions by: strajuser <https://github.com/strajuser>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -66,9 +66,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
@@ -346,6 +352,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;
}
/**
@@ -1002,6 +1015,15 @@ declare namespace L {
* @memberof Task
*/
token(token: string): this;
/**
*
*
* @param {boolean} returnUnformattedValues
* @returns {this}
* @memberof Task
*/
format(returnUnformattedValues: boolean): this;
}
/**
@@ -1334,6 +1356,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;
}
/**
@@ -1370,13 +1400,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.
*