@sswroom/sswr 1.6.9 → 1.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2329 @@
1
+ export const ImgPath: string;
2
+ export const VERSION_NUMBER: string;
3
+ /**
4
+ * Instances of this class represent bounding boxes. Data stored as left, bottom, right, top floats. All values are initialized to null, however, you should make sure you set them before using the bounds for anything.
5
+ */
6
+ export class Bounds
7
+ {
8
+ /**
9
+ * Construct a new bounds object. Coordinates can either be passed as four arguments, or as a single argument.
10
+ * @param left The left bounds of the box. Note that for width calculations, this is assumed to be less than the right value.
11
+ * @param bottom The bottom bounds of the box. Note that for height calculations, this is assumed to be less than the top value.
12
+ * @param right The right bounds.
13
+ * @param top The top bounds.
14
+ */
15
+ constructor(left: number, bottom: number, right: number, top: number);
16
+ /**
17
+ * Construct a new bounds object. Coordinates can either be passed as four arguments, or as a single argument.
18
+ * @param bounds
19
+ */
20
+ constructor(bounds: number[]);
21
+ /**
22
+ * Returns a string representation of the bounds object.
23
+ * @returns String representation of bounds object.
24
+ */
25
+ toString(): string;
26
+ /**
27
+ * Returns an array representation of the bounds object.
28
+ *
29
+ * Returns an array of left, bottom, right, top properties, or -- when the optional parameter is true -- an array of the bottom, left, top, right properties.
30
+ * @param reverseAxisOrder Should we reverse the axis order?
31
+ * @returns array of left, bottom, right, top
32
+ */
33
+ toArray(reverseAxisOrder?: boolean): number[];
34
+ /**
35
+ * Returns a boundingbox-string representation of the bounds object.
36
+ * @param decimal How many decimal places in the bbox coords? Default is 6
37
+ * @param reverseAxisOrder Should we reverse the axis order?
38
+ * @returns Simple String representation of bounds object. (e.g. “5,42,10,45”)
39
+ */
40
+ toBBOX(decimal?: number, reverseAxisOrder?: boolean): string;
41
+ /**
42
+ * Create a new polygon geometry based on this bounds.
43
+ * @returns A new polygon with the coordinates of this bounds.
44
+ */
45
+ toGeometry(): Geometry.Polygon;
46
+ /**
47
+ * Returns the width of the bounds.
48
+ * @returns The width of the bounds (right minus left).
49
+ */
50
+ getWidth(): number;
51
+ /**
52
+ * Returns the height of the bounds.
53
+ * @returns The height of the bounds (top minus bottom).
54
+ */
55
+ getHeight(): number;
56
+ /**
57
+ * Returns an OpenLayers.Size object of the bounds.
58
+ * @returns The size of the bounds.
59
+ */
60
+ getSize(): Size;
61
+ /**
62
+ * Returns the OpenLayers.Pixel object which represents the center of the bounds.
63
+ * @returns The center of the bounds in pixel space.
64
+ */
65
+ getCenterPixel(): Pixel;
66
+ /**
67
+ * Returns the OpenLayers.LonLat object which represents the center of the bounds.
68
+ * @returns The center of the bounds in map space.
69
+ */
70
+ getCenterLonLat(): LonLat;
71
+ /**
72
+ * Scales the bounds around a pixel or lonlat. Note that the new bounds may return non-integer properties, even if a pixel is passed.
73
+ * @param ratio
74
+ * @param origin Default is center.
75
+ * @returns A new bounds that is scaled by ratio from origin.
76
+ */
77
+ scale(ratio: number, origin?: Pixel|LonLat): Bounds;
78
+ /**
79
+ * Shifts the coordinates of the bound by the given horizontal and vertical deltas.
80
+ *
81
+ * This method will throw a TypeError if it is passed null as an argument.
82
+ * @param x horizontal delta
83
+ * @param y vertical delta
84
+ * @returns A new bounds whose coordinates are the same as this, but shifted by the passed-in x and y values.
85
+ */
86
+ add(x: number, y: number): Bounds;
87
+ /**
88
+ * Extend the bounds to include the OpenLayers.LonLat, OpenLayers.Geometry.Point or OpenLayers.Bounds specified.
89
+ *
90
+ * Please note that this function assumes that left < right and bottom < top.
91
+ * @param object The object to be included in the new bounds object.
92
+ */
93
+ extend(object: LonLat|Geometry.Point|Bounds): void;
94
+ /**
95
+ * Extend the bounds to include the XY coordinate specified.
96
+ * @param x The X part of the the coordinate.
97
+ * @param y The Y part of the the coordinate.
98
+ */
99
+ extendXY(x: number, y: number): void;
100
+ /**
101
+ * Returns whether the bounds object contains the given OpenLayers.LonLat.
102
+ * @param ll OpenLayers.LonLat or an object with a ‘lon’ and ‘lat’ properties.
103
+ * @param options Optional parameters
104
+ * @returns The passed-in lonlat is within this bounds.
105
+ */
106
+ containsLonLat(ll: LonLat|{lon:number,lat:number}, options?: {inclusive?: boolean, worldBounds?: Bounds}): boolean;
107
+ /**
108
+ * Returns whether the bounds object contains the given OpenLayers.Pixel.
109
+ * @param px
110
+ * @param inclusive Whether or not to include the border. Default is true.
111
+ * @returns The passed-in pixel is within this bounds.
112
+ */
113
+ containsPixel(px: Pixel, inclusive?: boolean): boolean;
114
+ /**
115
+ * Returns whether the bounds object contains the given x and y.
116
+ * @param x
117
+ * @param y
118
+ * @param inclusive Whether or not to include the border. Default is true.
119
+ * @returns Whether or not the passed-in coordinates are within this bounds.
120
+ */
121
+ contains(x: number, y: number, inclusive?: boolean): boolean;
122
+ /**
123
+ * Determine whether the target bounds intersects this bounds. Bounds are considered intersecting if any of their edges intersect or if one bounds contains the other.
124
+ * @param bounds The target bounds.
125
+ * @param options Optional parameters.
126
+ * @returns The passed-in bounds object intersects this bounds.
127
+ */
128
+ intersectsBounds(bounds: Bounds, options?: {inclusive?: boolean, worldBounds?: Bounds}): boolean;
129
+ /**
130
+ * Returns whether the bounds object contains the given OpenLayers.Bounds.
131
+ * @param bounds The target bounds.
132
+ * @param partial If any of the target corners is within this bounds consider the bounds contained. Default is false. If false, the entire target bounds must be contained within this bounds.
133
+ * @param inclusive Treat shared edges as contained. Default is true.
134
+ * @returns The passed-in bounds object is contained within this bounds.
135
+ */
136
+ containsBounds(bounds: Bounds, partial?: boolean, inclusive?: boolean): boolean;
137
+ /**
138
+ * Returns the the quadrant (“br”, “tr”, “tl”, “bl”) in which the given OpenLayers.LonLat lies.
139
+ * @param lonlat
140
+ * @returns The quadrant (“br” “tr” “tl” “bl”) of the bounds in which the coordinate lies.
141
+ */
142
+ determineQuadrant(lonlat: LonLat): string;
143
+ /**
144
+ * Transform the Bounds object from source to dest.
145
+ * @param source Source projection.
146
+ * @param dest Destination projection.
147
+ * @returns Itself, for use in chaining operations.
148
+ */
149
+ transform(source: Projection, dest: Projection): Bounds;
150
+ /**
151
+ * Alternative constructor that builds a new OpenLayers.Bounds from a parameter string.
152
+ * @param str Comma-separated bounds string. (e.g. “5,42,10,45”)
153
+ * @param reverseAxisOrder Does the string use reverse axis order?
154
+ * @returns New bounds object built from the passed-in String.
155
+ */
156
+ static fromString(str: string, reverseAxisOrder?: boolean): Bounds;
157
+ /**
158
+ * Alternative constructor that builds a new OpenLayers.Bounds from an array.
159
+ * @param bbox Array of bounds values (e.g. [5,42,10,45])
160
+ * @param reverseAxisOrder Does the array use reverse axis order?
161
+ * @returns New bounds object built from the passed-in Array.
162
+ */
163
+ static fromArray(bbox: number[], reverseAxisOrder?: boolean): Bounds;
164
+ /**
165
+ * Alternative constructor that builds a new OpenLayers.Bounds from a size.
166
+ * @param size OpenLayers.Size or an object with both ‘w’ and ‘h’ properties.
167
+ * @returns New bounds object built from the passed-in size.
168
+ */
169
+ static fromSize(size: Size|{w: number, h: number}): Bounds;
170
+ }
171
+
172
+ /**
173
+ * Controls affect the display or behavior of the map. They allow everything from panning and zooming to displaying a scale indicator. Controls by default are added to the map they are contained within however it is possible to add a control to an external div by passing the div in the options parameter.
174
+ * @example The following example shows how to add many of the common controls to a map.
175
+ * The next code fragment is a quick example of how to intercept shift-mouse click to display the extent of the bounding box dragged out by the user. Usually controls are not created in exactly this manner. See the source for a more complete example:
176
+ */
177
+ export class Control
178
+ {
179
+ /** The element that contains the control, if not present the control is placed inside the map. */
180
+ div: HTMLElement;
181
+ /** Controls can have a ‘type’. The type determines the type of interactions which are possible with them when they are placed in an OpenLayers.Control.Panel. */
182
+ type: number;
183
+ /** This property is used for showing a tooltip over the Control. */
184
+ title: string;
185
+ /** Activate the control when it is added to a map. Default is false. */
186
+ autoActivate: boolean;
187
+ /** The control is active (read-only). Use activate and deactivate to change control state. */
188
+ active: boolean;
189
+ /** If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on. Object structure must be a listeners object as shown in the example for the events.on method. */
190
+ eventListeners: object;
191
+ /** Events instance for listeners and triggering control specific events. */
192
+ events: Events;
193
+ /**
194
+ * Create an OpenLayers Control. The options passed as a parameter directly extend the control. For example passing the following:
195
+ * Overrides the default div attribute value of null.
196
+ * @param options
197
+ */
198
+ constructor(options: object);
199
+ /**
200
+ * Explicitly activates a control and its associated handler if one has been set. Controls can be deactivated by calling the deactivate() method.
201
+ * @returns True if the control was successfully activated or false if the control was already active.
202
+ */
203
+ activate(): boolean;
204
+ /**
205
+ * Deactivates a control and its associated handler if any. The exact effect of this depends on the control itself.
206
+ * @returns True if the control was effectively deactivated or false if the control was already inactive.
207
+ */
208
+ deactivate(): boolean;
209
+ static readonly TYPE_BUTTON: number;
210
+ static readonly TYPE_TOGGLE: number;
211
+ static readonly TYPE_TOOL: number;
212
+ }
213
+
214
+ namespace Control
215
+ {
216
+ /**
217
+ * The navigation control handles map browsing with mouse events (dragging, double-clicking, and scrolling the wheel). Create a new navigation control with the OpenLayers.Control.Navigation control.
218
+ *
219
+ * Note that this control is added to the map by default (if no controls array is sent in the options object to the OpenLayers.Map constructor).
220
+ */
221
+ export class Navigation extends Control
222
+ {
223
+ /** Options passed to the DragPan control. */
224
+ dragPanOptions: object;
225
+ /** Options passed to the PinchZoom control. */
226
+ pinchZoomOptions: object;
227
+ /** Allow panning of the map by dragging outside map viewport. Default is false. */
228
+ documentDrag: boolean;
229
+ /** Whether the user can draw a box to zoom */
230
+ zoomBoxEnabled: boolean;
231
+ /** Whether the mousewheel should zoom the map */
232
+ zoomWheelEnabled: boolean;
233
+ /** Whether or not to handle right clicks. Default is false. */
234
+ handleRightClicks: boolean;
235
+ /** OpenLayers.Handler key code of the key, which has to be pressed, while drawing the zoom box with the mouse on the screen. You should probably set handleRightClicks to true if you use this with MOD_CTRL, to disable the context menu for machines which use CTRL-Click as a right click. Default: <OpenLayers.Handler.MOD_SHIFT> */
236
+ zoomBoxKeyMask: number;
237
+ /** Activate the control when it is added to a map. Default is true. */
238
+ autoActivate: boolean;
239
+ /**
240
+ * Create a new navigation control
241
+ * @param options An optional object whose properties will be set on the control
242
+ */
243
+ constructor(options?: object);
244
+ }
245
+
246
+ /**
247
+ * The PanZoom is a visible control, composed of a OpenLayers.Control.PanPanel and a OpenLayers.Control.ZoomPanel. By default it is drawn in the upper left corner of the map.
248
+ */
249
+ export class PanZoom extends Control
250
+ {
251
+ /** Number of pixels by which we’ll pan the map in any direction on clicking the arrow buttons. If you want to pan by some ratio of the map dimensions, use slideRatio instead. */
252
+ slideFactor: number;
253
+ /** The fraction of map width/height by which we’ll pan the map on clicking the arrow buttons. Default is null. If set, will override slideFactor. E.g. if slideRatio is .5, then the Pan Up button will pan up half the map height. */
254
+ slideRatio: number;
255
+ constructor(options?: object);
256
+ destroy(): void;
257
+ readonly X: number;
258
+ readonly Y: number;
259
+ }
260
+
261
+ /**
262
+ * The PanZoomBar is a visible control composed of a OpenLayers.Control.PanPanel and a <OpenLayers.Control.ZoomBar>. By default it is displayed in the upper left corner of the map as 4 directional arrows above a vertical slider.
263
+ */
264
+ export class PanZoomBar extends PanZoom
265
+ {
266
+ zoomStopWidth: number;
267
+ zoomStopHeight: number;
268
+ zoomWorldIcon: boolean;
269
+ /** Set this property to false not to display the pan icons. If false the zoom world icon is placed under the zoom bar. Defaults to true. */
270
+ panIcons: boolean;
271
+ /** Force a fixed zoom level even though the map has fractionalZoom */
272
+ forceFixedZoomLevel: boolean;
273
+ constructor();
274
+ destroy(): void;
275
+ }
276
+ }
277
+
278
+ /**
279
+ * Utility functions for event handling.
280
+ */
281
+ export class Events
282
+ {
283
+ static readonly KEY_SPACE: number;
284
+ static readonly KEY_BACKSPACE: number;
285
+ static readonly KEY_TAB: number;
286
+ static readonly KEY_RETURN: number;
287
+ static readonly KEY_ESC: number;
288
+ static readonly KEY_LEFT: number;
289
+ static readonly KEY_UP: number;
290
+ static readonly KEY_RIGHT: number;
291
+ static readonly KEY_DOWN: number;
292
+ static readonly KEY_DELETE: number;
293
+ static readonly BROWSER_EVENTS: string[];
294
+
295
+ fallThrough: boolean;
296
+ /**
297
+ * Should the .xy property automatically be created for browser mouse events? In general, this should be false. If it is true, then mouse events will automatically generate a ‘.xy’ property on the event object that is passed. (Prior to OpenLayers 2.7, this was true by default.) Otherwise, you can call the getMousePosition on the relevant events handler on the object available via the ‘evt.object’ property of the evt object. So, for most events, you can call: function named(evt) { this.xy = this.object.events.getMousePosition(evt) }
298
+ *
299
+ * This option typically defaults to false for performance reasons
300
+ *
301
+ * when creating an events object whose primary purpose is to manage relatively positioned mouse events within a div, it may make sense to set it to true.
302
+ *
303
+ * This option is also used to control whether the events object caches offsets. If this is false, it will not: the reason for this is that it is only expected to be called many times if the includeXY property is set to true. If you set this to true, you are expected to clear the offset cache manually (using this.clearMouseCache()) if: the border of the element changes the location of the element in the page changes
304
+ */
305
+ includeXY: boolean;
306
+ /**
307
+ * Event extensions registered with this instance. Keys are event types, values are {OpenLayers.Events.*} extension instances or {Boolean} for events that an instantiated extension provides in addition to the one it was created for.
308
+ *
309
+ * Extensions create an event in addition to browser events, which usually fires when a sequence of browser events is completed. Extensions are automatically instantiated when a listener is registered for an event provided by an extension.
310
+ *
311
+ * Extensions are created in the OpenLayers.Events namespace using OpenLayers.Class, and named after the event they provide. The constructor receives the target OpenLayers.Events instance as argument. Extensions that need to capture browser events before they propagate can register their listeners events using register, with {extension: true} as 4th argument.
312
+ *
313
+ * If an extension creates more than one event, an alias for each event type should be created and reference the same class. The constructor should set a reference in the target’s extensions registry to itself.
314
+ *
315
+ * Below is a minimal extension that provides the “foostart” and “fooend” event types, which replace the native “click” event type if clicked on an element with the css class “foo”:
316
+ */
317
+ extensions: object;
318
+ /**
319
+ * Construct an OpenLayers.Events object.
320
+ * @param object The js object to which this Events object is being added
321
+ * @param element A dom element to respond to browser events
322
+ * @param eventType Deprecated. Array of custom application events. A listener may be registered for any named event, regardless of the values provided here.
323
+ * @param fallThrough Allow events to fall through after these have been handled?
324
+ * @param options Options for the events object.
325
+ */
326
+ constructor(object: object, element: HTMLElement, eventType: string[], fallThrough: boolean, options: object);
327
+ destroy(): void;
328
+ /**
329
+ * Deprecated. Any event can be triggered without adding it first.
330
+ * @param eventName
331
+ */
332
+ addEventType(eventName: string): void;
333
+ /**
334
+ * Convenience method for registering listeners with a common scope. Internally, this method calls register as shown in the examples below.
335
+ * @param object
336
+ */
337
+ on(object: object): void;
338
+ /**
339
+ * Register an event on the events object.
340
+ *
341
+ * When the event is triggered, the ‘func’ function will be called, in the context of ‘obj’. Imagine we were to register an event, specifying an OpenLayers.Bounds Object as ‘obj’. When the event is triggered, the context in the callback function will be our Bounds object. This means that within our callback function, we can access the properties and methods of the Bounds object through the “this” variable. So our callback could execute something like:
342
+ * @param type Name of the event to register
343
+ * @param obj The object to bind the context to for the callback#. If no object is specified, default is the Events’s ‘object’ property.
344
+ * @param func The callback function. If no callback is specified, this function does nothing.
345
+ * @param priority If true, adds the new listener to the front of the events queue instead of to the end.
346
+ */
347
+ register(type: string, obj: object, func: Function, priority: boolean|object): void;
348
+ /**
349
+ * Same as register() but adds the new listener to the front of the events queue instead of to the end.
350
+ * TODO: get rid of this in 3.0 Decide whether listeners should be called in the order they were registered or in reverse order.
351
+ * @param type Name of the event to register
352
+ * @param obj The object to bind the context to for the callback#. If no object is specified, default is the Events’s ‘object’ property.
353
+ * @param func The callback function. If no callback is specified, this function does nothing.
354
+ */
355
+ registerPriority(type: string, obj: object, func: Function): void;
356
+ /**
357
+ * Convenience method for unregistering listeners with a common scope. Internally, this method calls unregister as shown in the examples below.
358
+ * @param object
359
+ */
360
+ un(object: object): void;
361
+ /**
362
+ * @param type
363
+ * @param obj If none specified, defaults to this.object
364
+ * @param func
365
+ */
366
+ unregister(type: string, obj: object, func: Function): void;
367
+ /**
368
+ * Trigger a specified registered event.
369
+ * @param type
370
+ * @param evt will be passed to the listeners.
371
+ * @returns The last listener return. If a listener returns false, the chain of listeners will stop getting called.
372
+ */
373
+ triggerEvent(type: string, evt: Event|object): boolean;
374
+ /**
375
+ * Clear cached data about the mouse position. This should be called any time the element that events are registered on changes position within the page.
376
+ */
377
+ clearMouseCache(): void;
378
+ }
379
+
380
+ export abstract class Feature
381
+ {
382
+ popupClass: Class;
383
+ constructor(layer: Layer, lonlat: LonLat, data: object);
384
+ }
385
+
386
+ export class Style
387
+ {
388
+ fill?: boolean;
389
+ fillColor?: string;
390
+ fillOpacity?: number;
391
+ stroke?: boolean;
392
+ strokeColor?: string;
393
+ strokeOpacity?: number;
394
+ strokeWidth?: number;
395
+ strokeLinecap?: string;
396
+ strokeDashstyle?: string;
397
+ graphic?: boolean;
398
+ pointRadius?: number;
399
+ pointerEvents?: string;
400
+ cursor?: string;
401
+ externalGraphic?: string;
402
+ graphicWidth?: number;
403
+ graphicHeight?: number;
404
+ graphicOpacity?: number;
405
+ graphicXOffset?: number;
406
+ graphicYOffset?: number;
407
+ rotation?: number;
408
+ graphicZIndex?: number;
409
+ graphicName?: string;
410
+ graphicTitle?: string;
411
+ title?: string;
412
+ backgroundGraphic?: string;
413
+ backgroundGraphicZIndex?: number;
414
+ backgroundXOffset?: number;
415
+ backgroundYOffset?: number;
416
+ backgroundHeight?: number;
417
+ backgroundWidth?: number;
418
+ label?: string;
419
+ labelAlign?: string;
420
+ labelXOffset?: number;
421
+ labelYOffset?: number;
422
+ labelSelect?: boolean;
423
+ labelOutlineColor?: string;
424
+ labelOutlineWidth?: number;
425
+ labelOutlineOpacity?: number;
426
+ fontColor?: string;
427
+ fontOpacity?: number;
428
+ fontFamily?: string;
429
+ fontSize?: string;
430
+ fontStyle?: string;
431
+ fontWeight?: string;
432
+ display?: string;
433
+ }
434
+
435
+ namespace Feature
436
+ {
437
+ export class Vector extends Feature
438
+ {
439
+ geometry: Geometry;
440
+ attributes?: any;
441
+ style?: Style;
442
+ url: string;
443
+ modified: object;
444
+ constructor(geometry: Geometry, attributes?: any, style?: Style);
445
+ }
446
+ }
447
+
448
+ /**
449
+ * A Geometry is a description of a geographic object. Create an instance of this class with the OpenLayers.Geometry constructor. This is a base class, typical geometry types are described by subclasses of this class.
450
+ *
451
+ * Note that if you use the <OpenLayers.Geometry.fromWKT> method, you must explicitly include the OpenLayers.Format.WKT in your build.
452
+ */
453
+ export abstract class Geometry
454
+ {
455
+ /**
456
+ * Create a clone of this geometry. Does not set any non-standard properties of the cloned geometry.
457
+ * @returns An exact clone of this geometry.
458
+ */
459
+ clone(): Geometry;
460
+ /**
461
+ * Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.
462
+ * @returns
463
+ */
464
+ getBounds(): Bounds;
465
+ /**
466
+ * Recalculate the bounds for the geometry.
467
+ */
468
+ calculateBounds(): void;
469
+ /**
470
+ * Calculate the closest distance between two geometries (on the x-y plane).
471
+ * @param geometry The target geometry.
472
+ * @param options Optional properties for configuring the distance calculation. Valid options depend on the specific geometry type.
473
+ * @returns The distance between this geometry and the target. If details is true, the return will be an object with distance, x0, y0, x1, and y1 properties. The x0 and y0 properties represent the coordinates of the closest point on this geometry. The x1 and y1 properties represent the coordinates of the closest point on the target geometry.
474
+ */
475
+ distanceTo(geometry: Geometry, options?: any): number|{distance: number, x0: number, y0: number, x1: number, y1: number};
476
+ /**
477
+ * Return a list of all points in this geometry.
478
+ * @param nodes For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
479
+ * @returns A list of all vertices in the geometry.
480
+ */
481
+ getVertices(nodes: boolean): Geometry.Point[];
482
+ /**
483
+ * Calculate the centroid of this geometry. This method is defined in subclasses.
484
+ * @returns The centroid of the collection
485
+ */
486
+ getCentroid(weighted?: boolean): Geometry.Point;
487
+ }
488
+
489
+ namespace Geometry
490
+ {
491
+ /**
492
+ * Point geometry class.
493
+ */
494
+ export class Point extends Geometry
495
+ {
496
+ x: number;
497
+ y: number;
498
+ /**
499
+ * Construct a point geometry.
500
+ * @param x
501
+ * @param y
502
+ */
503
+ constructor(x: number, y: number);
504
+ /**
505
+ * @returns An exact clone of this OpenLayers.Geometry.Point
506
+ */
507
+ clone(): Point;
508
+ /**
509
+ * Calculate the closest distance between two geometries (on the x-y plane).
510
+ * @param geometry The target geometry.
511
+ * @param options Optional properties for configuring the distance calculation.
512
+ * @returns The distance between this geometry and the target. If details is true, the return will be an object with distance, x0, y0, x1, and y1 properties. The x0 and y0 properties represent the coordinates of the closest point on this geometry. The x1 and y1 properties represent the coordinates of the closest point on the target geometry.
513
+ */
514
+ distanceTo(geometry: Geometry, options?: {details?: boolean, edge?: boolean}): number|{distance: number, x0: number, y0: number, x1: number, y1: number};
515
+ /**
516
+ * Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.
517
+ * @param geom The geometry to test.
518
+ * @returns The supplied geometry is equivalent to this geometry.
519
+ */
520
+ equals(geom: Point): boolean;
521
+ /**
522
+ * Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.
523
+ * @param x Distance to move geometry in positive x direction.
524
+ * @param y Distance to move geometry in positive y direction.
525
+ */
526
+ move(x: number, y: number): void;
527
+ /**
528
+ * Rotate a point around another.
529
+ * @param angle Rotation angle in degrees (measured counterclockwise from the positive x-axis)
530
+ * @param origin Center point for the rotation
531
+ */
532
+ rotate(angle: number, origin: Point): void;
533
+ /**
534
+ * @returns The centroid of the collection
535
+ */
536
+ getCentroid(): Point;
537
+ /**
538
+ * Resize a point relative to some origin. For points, this has the effect of scaling a vector (from the origin to the point). This method is more useful on geometry collection subclasses.
539
+ * @param scale Ratio of the new distance from the origin to the old distance from the origin. A scale of 2 doubles the distance between the point and origin.
540
+ * @param origin Point of origin for resizing
541
+ * @param ratio Optional x:y ratio for resizing. Default ratio is 1.
542
+ * @returns The current geometry.
543
+ */
544
+ resize(scale: number, origin: Point, ratio?: number): Geometry;
545
+ /**
546
+ * Determine if the input geometry intersects this one.
547
+ * @param geometry Any type of geometry.
548
+ * @returns The input geometry intersects this one.
549
+ */
550
+ intersects(geometry: Geometry): boolean;
551
+ /**
552
+ * Translate the x,y properties of the point from source to dest.
553
+ * @param source
554
+ * @param dest
555
+ */
556
+ transform(source: Projection, dest: Projection): Geometry;
557
+ /**
558
+ * Return a list of all points in this geometry.
559
+ * @param nodes For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
560
+ * @returns A list of all vertices in the geometry.
561
+ */
562
+ getVertices(nodes: boolean): Point[];
563
+ }
564
+
565
+ export class Collection extends Geometry
566
+ {
567
+ /**
568
+ * The component parts of this geometry
569
+ */
570
+ components: Geometry[];
571
+ /**
572
+ * Creates a Geometry Collection -- a list of geoms.
573
+ * @param components Optional array of geometries
574
+ */
575
+ constructor(components: Geometry[]);
576
+ /**
577
+ * Destroy this geometry.
578
+ */
579
+ destroy(): void;
580
+ /**
581
+ * Clone this geometry.
582
+ * @returns An exact clone of this collection
583
+ */
584
+ clone(): Collection;
585
+ /**
586
+ * Recalculate the bounds by iterating through the components and calling calling extendBounds() on each item.
587
+ */
588
+ calculateBounds(): void;
589
+ /**
590
+ * Add components to this geometry.
591
+ * @param components An array of geometries to add
592
+ */
593
+ addComponents(components: Geometry[]): void;
594
+ /**
595
+ * Remove components from this geometry
596
+ * @param components The components to be removed
597
+ * @returns A component was removed.
598
+ */
599
+ removeComponents(components: Geometry[]): boolean;
600
+ /**
601
+ * Calculate the length of this geometry
602
+ * @returns The length of the geometry
603
+ */
604
+ getLength(): number;
605
+ /**
606
+ * Calculate the area of this geometry. Note how this function is overridden in OpenLayers.Geometry.Polygon.
607
+ * @returns The area of the collection by summing its parts
608
+ */
609
+ getArea(): number;
610
+ /**
611
+ * Calculate the approximate area of the polygon were it projected onto the earth.
612
+ * @param projection The spatial reference system for the geometry coordinates. If not provided, Geographic/WGS84 is assumed.
613
+ * @external Robert. G. Chamberlain and William H. Duquette, “Some Algorithms for Polygons on a Sphere”, JPL Publication 07-03, Jet Propulsion Laboratory, Pasadena, CA, June 2007 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409
614
+ * @returns The approximate geodesic area of the geometry in square meters.
615
+ */
616
+ getGeodesicArea(projection?: Projection): number;
617
+ /**
618
+ * Compute the centroid for this geometry collection.
619
+ * @param weighted Perform the getCentroid computation recursively, returning an area weighted average of all geometries in this collection.
620
+ * @returns The centroid of the collection
621
+ */
622
+ getCentroid(weighted?: boolean): Point;
623
+ /**
624
+ * Calculate the approximate length of the geometry were it projected onto the earth.
625
+ * @param projection The spatial reference system for the geometry coordinates. If not provided, Geographic/WGS84 is assumed.
626
+ * @returns The appoximate geodesic length of the geometry in meters.
627
+ */
628
+ getGeodesicLength(projection?: Projection): number;
629
+ /**
630
+ * Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.
631
+ * @param x Distance to move geometry in positive x direction.
632
+ * @param y Distance to move geometry in positive y direction.
633
+ */
634
+ move(x: number, y: number): void;
635
+ /**
636
+ * Rotate a geometry around some origin
637
+ * @param angle Rotation angle in degrees (measured counterclockwise from the positive x-axis)
638
+ * @param origin Center point for the rotation
639
+ */
640
+ rotate(angle: number, origin: Point): void;
641
+ /**
642
+ * Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.
643
+ * @param scale Factor by which to scale the geometry. A scale of 2 doubles the size of the geometry in each dimension (lines, for example, will be twice as long, and polygons will have four times the area).
644
+ * @param origin Point of origin for resizing
645
+ * @param ratio Optional x:y ratio for resizing. Default ratio is 1.
646
+ * @return The current geometry.
647
+ */
648
+ resize(scale: number, origin: Point, ratio: number): Geometry;
649
+ /**
650
+ * Calculate the closest distance between two geometries (on the x-y plane).
651
+ * @param geometry The target geometry.
652
+ * @param options Optional properties for configuring the distance calculation.
653
+ * @returns The distance between this geometry and the target. If details is true, the return will be an object with distance, x0, y0, x1, and y1 properties. The x0 and y0 properties represent the coordinates of the closest point on this geometry. The x1 and y1 properties represent the coordinates of the closest point on the target geometry.
654
+ */
655
+ distanceTo(geometry: Geometry, options: {details?: boolean, edge?: boolean}): number|{distance:number,x0:number,y0:number,x1:number,y1:number};
656
+ /**
657
+ * Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.
658
+ * @param geometry The geometry to test.
659
+ * @returns The supplied geometry is equivalent to this geometry.
660
+ */
661
+ equals(geometry: Geometry): boolean;
662
+ /**
663
+ * Reproject the components geometry from source to dest.
664
+ * @param source
665
+ * @param dest
666
+ */
667
+ transform(source: Projection, dest: Projection): Geometry;
668
+ /**
669
+ * Determine if the input geometry intersects this one.
670
+ * @param geometry Any type of geometry.
671
+ * @returns The input geometry intersects this one.
672
+ */
673
+ intersects(geometry: Geometry): boolean;
674
+ /**
675
+ * Return a list of all points in this geometry.
676
+ * @param nodes For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
677
+ * @returns A list of all vertices in the geometry.
678
+ */
679
+ getVertices(nodes?: boolean): Point[];
680
+ }
681
+
682
+ export class MultiPoint extends Collection
683
+ {
684
+ /**
685
+ * Create a new MultiPoint Geometry
686
+ * @param components
687
+ */
688
+ constructor(components: Point[]);
689
+ /**
690
+ * Wrapper for <OpenLayers.Geometry.Collection.addComponent>
691
+ * @param point Point to be added
692
+ * @param index Optional index
693
+ */
694
+ addPoint(point: Point, index?: number): void;
695
+ /**
696
+ * Wrapper for <OpenLayers.Geometry.Collection.removeComponent>
697
+ * @param point Point to be removed
698
+ */
699
+ removePoint(point: Point): void;
700
+ }
701
+
702
+ export class Curve extends MultiPoint
703
+ {
704
+ /**
705
+ *
706
+ * @param point
707
+ */
708
+ constructor(point: Point[]);
709
+ /**
710
+ * @returns The length of the curve
711
+ */
712
+ getLength(): number;
713
+ /**
714
+ * Calculate the approximate length of the geometry were it projected onto the earth.
715
+ * @param projection The spatial reference system for the geometry coordinates. If not provided, Geographic/WGS84 is assumed.
716
+ * @returns The appoximate geodesic length of the geometry in meters.
717
+ */
718
+ getGeodesicLength(projection?: Projection): number;
719
+ }
720
+
721
+ /**
722
+ * A LineString is a Curve which, once two points have been added to it, can never be less than two points long.
723
+ */
724
+ export class LineString extends Curve
725
+ {
726
+ /**
727
+ * Create a new LineString geometry
728
+ * @param points An array of points used to generate the linestring
729
+ */
730
+ constructor(points: Point[]);
731
+ /**
732
+ * Only allows removal of a point if there are three or more points in the linestring. (otherwise the result would be just a single point)
733
+ * @param point The point to be removed
734
+ * @returns The component was removed.
735
+ */
736
+ removeComponent(point: Point): boolean;
737
+ /**
738
+ * Test for instersection between two geometries. This is a cheapo implementation of the Bently-Ottmann algorigithm. It doesn’t really keep track of a sweep line data structure. It is closer to the brute force method, except that segments are sorted and potential intersections are only calculated when bounding boxes intersect.
739
+ * @param geometry
740
+ * @returns The input geometry intersects this geometry.
741
+ */
742
+ intersects(geometry: Geometry): boolean;
743
+ /**
744
+ * Return a list of all points in this geometry.
745
+ * @param nodes For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
746
+ * @returns A list of all vertices in the geometry.
747
+ */
748
+ getVertices(nodes: boolean): Point[];
749
+ /**
750
+ * Calculate the closest distance between two geometries (on the x-y plane).
751
+ * @param geometry The target geometry.
752
+ * @param options Optional properties for configuring the distance calculation.
753
+ * @returns The distance between this geometry and the target. If details is true, the return will be an object with distance, x0, y0, x1, and y1 properties. The x0 and y0 properties represent the coordinates of the closest point on this geometry. The x1 and y1 properties represent the coordinates of the closest point on the target geometry.
754
+ */
755
+ distanceTo(geometry: Geometry, options?: {details?: boolean, edge?: boolean}): number|{distance: number, x0: number, y0: number, x1: number, y1: number};
756
+ /**
757
+ * This function will return a simplified LineString. Simplification is based on the Douglas-Peucker algorithm.
758
+ * @param tolerance threshold for simplification in map units
759
+ * @returns the simplified LineString
760
+ */
761
+ simplify(tolerance: number): LineString;
762
+ }
763
+
764
+ /**
765
+ * A Linear Ring is a special LineString which is closed. It closes itself automatically on every addPoint/removePoint by adding a copy of the first point as the last point.
766
+ *
767
+ * Also, as it is the first in the line family to close itself, a getArea() function is defined to calculate the enclosed area of the linearRing
768
+ */
769
+ export class LinearRing extends LineString
770
+ {
771
+ /**
772
+ * Linear rings are constructed with an array of points. This array can represent a closed or open ring. If the ring is open (the last point does not equal the first point), the constructor will close the ring. If the ring is already closed (the last point does equal the first point), it will be left closed.
773
+ * @param points points
774
+ */
775
+ constructor(points: Point[]);
776
+ /**
777
+ * Adds a point to geometry components. If the point is to be added to the end of the components array and it is the same as the last point already in that array, the duplicate point is not added. This has the effect of closing the ring if it is not already closed, and doing the right thing if it is already closed. This behavior can be overridden by calling the method with a non-null index as the second argument.
778
+ * @param point
779
+ * @param index Index into the array to insert the component
780
+ * @returns Was the Point successfully added?
781
+ */
782
+ addComponents(point: Point, index?: number): boolean;
783
+ /**
784
+ * Removes a point from geometry components.
785
+ * @param point
786
+ * @returns The component was removed.
787
+ */
788
+ removeComponent(point: Point): boolean;
789
+ /**
790
+ * Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.
791
+ * @param x Distance to move geometry in positive x direction.
792
+ * @param y Distance to move geometry in positive y direction.
793
+ */
794
+ move(x: number, y: number): void;
795
+ /**
796
+ * Rotate a geometry around some origin
797
+ * @param angle Rotation angle in degrees (measured counterclockwise from the positive x-axis)
798
+ * @param origin Center point for the rotation
799
+ */
800
+ rotate(angle: number, origin: Point): void;
801
+ /**
802
+ * Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry.
803
+ * @param scale Factor by which to scale the geometry. A scale of 2 doubles the size of the geometry in each dimension (lines, for example, will be twice as long, and polygons will have four times the area).
804
+ * @param origin Point of origin for resizing
805
+ * @param ratio Optional x:y ratio for resizing. Default ratio is 1.
806
+ */
807
+ resize(scale: number, origin: Point, ratio?: number): Geometry;
808
+ /**
809
+ * Reproject the components geometry from source to dest.
810
+ * @param source
811
+ * @param dest
812
+ */
813
+ transform(source: Projection, dest: Projection): Geometry;
814
+ /**
815
+ * @param weighted
816
+ * @returns The centroid of the collection
817
+ */
818
+ getCentroid(weighted?: boolean): Point;
819
+ /**
820
+ * @description The area is positive if the ring is oriented CW, otherwise it will be negative.
821
+ * @returns The signed area for a ring.
822
+ */
823
+ getArea(): number;
824
+ /**
825
+ * Calculate the approximate area of the polygon were it projected onto the earth. Note that this area will be positive if ring is oriented clockwise, otherwise it will be negative.
826
+ * @param projection The spatial reference system for the geometry coordinates. If not provided, Geographic/WGS84 is assumed.
827
+ * @description Robert. G. Chamberlain and William H. Duquette, “Some Algorithms for Polygons on a Sphere”, JPL Publication 07-03, Jet Propulsion Laboratory, Pasadena, CA, June 2007 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409
828
+ * @returns The approximate signed geodesic area of the polygon in square meters.
829
+ */
830
+ getGeodesicArea(projection?: Projection): number;
831
+ /**
832
+ * Determine if the input geometry intersects this one.
833
+ * @param geometry Any type of geometry.
834
+ * @returns The input geometry intersects this one.
835
+ */
836
+ intersects(geometry: Geometry): boolean;
837
+ /**
838
+ * Return a list of all points in this geometry.
839
+ * @param nodes For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
840
+ * @returns A list of all vertices in the geometry.
841
+ */
842
+ getVertices(nodes: boolean): Point[];
843
+ }
844
+
845
+ /**
846
+ * Polygon is a collection of Geometry.LinearRings.
847
+ */
848
+ export class Polygon extends Collection
849
+ {
850
+ /**
851
+ * Constructor for a Polygon geometry. The first ring (this.component[0])is the outer bounds of the polygon and all subsequent rings (this.component[1-n]) are internal holes.
852
+ * @param components
853
+ */
854
+ constructor(components: LinearRing[]);
855
+ /**
856
+ * Calculated by subtracting the areas of the internal holes from the area of the outer hole.
857
+ * @returns The area of the geometry
858
+ */
859
+ getArea(): number;
860
+ /**
861
+ * Calculate the approximate area of the polygon were it projected onto the earth.
862
+ * @param projection The spatial reference system for the geometry coordinates. If not provided, Geographic/WGS84 is assumed.
863
+ * @description Robert. G. Chamberlain and William H. Duquette, “Some Algorithms for Polygons on a Sphere”, JPL Publication 07-03, Jet Propulsion Laboratory, Pasadena, CA, June 2007 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409
864
+ * @returns The approximate geodesic area of the polygon in square meters.
865
+ */
866
+ getGeodesicArea(projection: Projection): number;
867
+ /**
868
+ * Determine if the input geometry intersects this one.
869
+ * @param geometry Any type of geometry.
870
+ * @returns The input geometry intersects this one.
871
+ */
872
+ intersects(geometry: Geometry): boolean;
873
+ /**
874
+ * Calculate the closest distance between two geometries (on the x-y plane).
875
+ * @param geometry The target geometry.
876
+ * @param options Optional properties for configuring the distance calculation.
877
+ * @returns The distance between this geometry and the target. If details is true, the return will be an object with distance, x0, y0, x1, and y1 properties. The x0 and y0 properties represent the coordinates of the closest point on this geometry. The x1 and y1 properties represent the coordinates of the closest point on the target geometry.
878
+ */
879
+ distanceTo(geometry: Geometry, options: { details?: boolean; edge?: boolean; }): number | { distance: number; x0: number; y0: number; x1: number; y1: number; };
880
+ /**
881
+ * Create a regular polygon around a radius. Useful for creating circles and the like.
882
+ * @param origin center of polygon.
883
+ * @param radius distance to vertex, in map units.
884
+ * @param sides Number of sides. 20 approximates a circle.
885
+ * @param rotation original angle of rotation, in degrees.
886
+ */
887
+ static createRegularPolygon(origin: Point, radius: number, sides: number, rotation: number): Polygon;
888
+ }
889
+
890
+ /**
891
+ * MultiPolygon is a geometry with multiple OpenLayers.Geometry.Polygon components. Create a new instance with the OpenLayers.Geometry.MultiPolygon constructor.
892
+ */
893
+ export class MultiPolygon extends Collection
894
+ {
895
+ /**
896
+ * Create a new MultiPolygon geometry
897
+ * @param components An array of polygons used to generate the MultiPolygon
898
+ */
899
+ constructor(components: Polygon[]);
900
+ }
901
+ }
902
+
903
+ /**
904
+ * Base class to construct a higher-level handler for event sequences. All handlers have activate and deactivate methods. In addition, they have methods named like browser events. When a handler is activated, any additional methods named like a browser event is registered as a listener for the corresponding event. When a handler is deactivated, those same methods are unregistered as event listeners.
905
+ *
906
+ * Handlers also typically have a callbacks object with keys named like the abstracted events or event sequences that they are in charge of handling. The controls that wrap handlers define the methods that correspond to these abstract events - so instead of listening for individual browser events, they only listen for the abstract events defined by the handler.
907
+ *
908
+ * Handlers are created by controls, which ultimately have the responsibility of making changes to the the state of the application. Handlers themselves may make temporary changes, but in general are expected to return the application in the same state that they found it.
909
+ */
910
+ export class Handler
911
+ {
912
+ /** The control that initialized this handler. The control is assumed to have a valid map property - that map is used in the handler’s own setMap method. */
913
+ control: Control;
914
+ /** Use bitwise operators and one or more of the OpenLayers.Handler constants to construct a keyMask. The keyMask is used by <checkModifiers>. If the keyMask matches the combination of keys down on an event, checkModifiers returns true. */
915
+ keyMask: number;
916
+ /**
917
+ * Construct a handler.
918
+ * @param control The control that initialized this handler. The control is assumed to have a valid map property; that map is used in the handler’s own setMap method. If a map property is present in the options argument it will be used instead.
919
+ * @param callbacks An object whose properties correspond to abstracted events or sequences of browser events. The values for these properties are functions defined by the control that get called by the handler.
920
+ * @param options An optional object whose properties will be set on the handler.
921
+ */
922
+ constructor(control: Control, callbacks?: object, options?: object);
923
+ /**
924
+ * Turn on the handler. Returns false if the handler was already active.
925
+ * @returns The handler was activated.
926
+ */
927
+ activate(): boolean;
928
+ /**
929
+ * Turn off the handler. Returns false if the handler was already inactive.
930
+ * @returns The handler was deactivated.
931
+ */
932
+ deactivate(): boolean;
933
+ /** If set as the keyMask, <checkModifiers> returns false if any key is down. */
934
+ static readonly MOD_NONE: number;
935
+ /** If set as the keyMask, <checkModifiers> returns false if Shift is down. */
936
+ static readonly MOD_SHIFT: number;
937
+ /** If set as the keyMask, <checkModifiers> returns false if Ctrl is down. */
938
+ static readonly MOD_CTRL: number;
939
+ /** If set as the keyMask, <checkModifiers> returns false if Alt is down. */
940
+ static readonly MOD_ALT: number;
941
+ /** If set as the keyMask, <checkModifiers> returns false if Cmd is down. */
942
+ static readonly MOD_META: number;
943
+ }
944
+
945
+ namespace Handler
946
+ {
947
+ /**
948
+ * A handler for mouse clicks. The intention of this handler is to give controls more flexibility with handling clicks. Browsers trigger click events twice for a double-click. In addition, the mousedown, mousemove, mouseup sequence fires a click event. With this handler, controls can decide whether to ignore clicks associated with a double click. By setting a pixelTolerance, controls can also ignore clicks that include a drag. Create a new instance with the OpenLayers.Handler.Click constructor.
949
+ */
950
+ export class Click extends Handler
951
+ {
952
+ /** Number of milliseconds between clicks before the event is considered a double-click. */
953
+ delay: number;
954
+ /** Handle single clicks. Default is true. If false, clicks will not be reported. If true, single-clicks will be reported. */
955
+ single: boolean;
956
+ /** Handle double-clicks. Default is false. */
957
+ double: boolean;
958
+ /** Maximum number of pixels between mouseup and mousedown for an event to be considered a click. Default is 0. If set to an integer value, clicks with a drag greater than the value will be ignored. This property can only be set when the handler is constructed. */
959
+ pixelTolerance: number;
960
+ /** Maximum distance in pixels between clicks for a sequence of events to be considered a double click. Default is 13. If the distance between two clicks is greater than this value, a double- click will not be fired. */
961
+ dblclickTolerance: number;
962
+ /** Stop other listeners from being notified of clicks. Default is false. If true, any listeners registered before this one for click or rightclick events will not be notified. */
963
+ stopSingle: boolean;
964
+ /**
965
+ * Stop other listeners from being notified of double-clicks. Default is false. If true, any click listeners registered before this one will not be notified of any double-click events.
966
+ *
967
+ * The one caveat with stopDouble is that given a map with two click handlers, one with stopDouble true and the other with stopSingle true, the stopSingle handler should be activated last to get uniform cross-browser performance. Since IE triggers one click with a dblclick and FF triggers two, if a stopSingle handler is activated first, all it gets in IE is a single click when the second handler stops propagation on the dblclick.
968
+ */
969
+ stopDouble: boolean;
970
+ /**
971
+ * Create a new click handler.
972
+ * @param control The control that is making use of this handler. If a handler is being used without a control, the handler’s setMap method must be overridden to deal properly with the map.
973
+ * @param callbacks An object with keys corresponding to callbacks that will be called by the handler. The callbacks should expect to receive a single argument, the click event. Callbacks for ‘click’ and ‘dblclick’ are supported.
974
+ * @param options Optional object whose properties will be set on the handler.
975
+ */
976
+ constructor(control: Control, callbacks?: object, options: object);
977
+ /**
978
+ * Deactivate the handler.
979
+ * @returns The handler was successfully deactivated.
980
+ */
981
+ deactivate(): boolean;
982
+ }
983
+ }
984
+
985
+ /**
986
+ * The icon represents a graphical icon on the screen. Typically used in conjunction with a OpenLayers.Marker to represent markers on a screen.
987
+ *
988
+ * An icon has a url, size and position. It also contains an offset which allows the center point to be represented correctly. This can be provided either as a fixed offset or a function provided to calculate the desired offset.
989
+ */
990
+ export class Icon
991
+ {
992
+ url: string;
993
+ size: Size;
994
+ offset: Pixel;
995
+ imageDiv: HTMLImageElement;
996
+
997
+ /**
998
+ * Creates an icon, which is an image tag in a div.
999
+ * @param url
1000
+ * @param size An OpenLayers.Size or an object with a ‘w’ and ‘h’ properties.
1001
+ * @param offset An OpenLayers.Pixel or an object with a ‘x’ and ‘y’ properties.
1002
+ * @param calculateOffset
1003
+ */
1004
+ constructor(url: string, size: Size|{w: number, h: number}, offset: Pixel|{x: number, y: number}, calculateOffset?: ()=>void);
1005
+ /**
1006
+ * @returns Whether or not the icon is drawn.
1007
+ */
1008
+ isDrawn(): boolean;
1009
+ }
1010
+
1011
+ export class Layer
1012
+ {
1013
+ id: string;
1014
+ name: string;
1015
+ div: HTMLDivElement;
1016
+ /** The layer’s opacity. Float number between 0.0 and 1.0. Default is 1. */
1017
+ opacity?: number;
1018
+ /**
1019
+ * If a layer’s display should not be scale-based, this should be set to true. This will cause the layer, as an overlay, to always be ‘active’, by always returning true from the calculateInRange() function.
1020
+ *
1021
+ * If not explicitly specified for a layer, its value will be determined on startup in initResolutions() based on whether or not any scale-specific properties have been set as options on the layer. If no scale-specific options have been set on the layer, we assume that it should always be in range.
1022
+ *
1023
+ * See #987 for more info.
1024
+ */
1025
+ alwaysInRange: boolean;
1026
+ /** The properties that are used for calculating resolutions information. */
1027
+ static readonly RESOLUTION_PROPERTIES: Array;
1028
+ /** Listeners will be called with a reference to an event object. The properties of this event depends on exactly what happened. */
1029
+ events: Events;
1030
+ /** This variable is set when the layer is added to the map, via the accessor function setMap(). */
1031
+ map: Map;
1032
+ /** Whether or not the layer is a base layer. This should be set individually by all subclasses. Default is false */
1033
+ isBaseLayer?: boolean;
1034
+ /** Display the layer’s name in the layer switcher. Default is true. */
1035
+ displayInLayerSwitcher?: boolean;
1036
+ /** The layer should be displayed in the map. Default is true. */
1037
+ visibility?: boolean;
1038
+ /**
1039
+ * Attribution information, displayed when an OpenLayers.Control.Attribution has been added to the map.
1040
+ *
1041
+ * An object is required to store the full attribution information from a WMS capabilities response. Example attribution object: {title:””,href:””,logo:{format:””,width:10,height:10,href:””}}
1042
+ */
1043
+ attribution: string|{title: string, href: string, logo: {format: string, width: number, height: number, href: string}};
1044
+ /** If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on. Object structure must be a listeners object as shown in the example for the events.on method. */
1045
+ eventListeners: object;
1046
+ /** Determines the width (in pixels) of the gutter around image tiles to ignore. By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter. This allows artifacts of rendering at tile edges to be ignored. Set a gutter value that is equal to half the size of the widest symbol that needs to be displayed. Defaults to zero. Non-tiled layers always have zero gutter. */
1047
+ gutter: number;
1048
+ /**
1049
+ * Specifies the projection of the layer. Can be set in the layer options. If not specified in the layer options, it is set to the default projection specified in the map, when the layer is added to the map. Projection along with default maxExtent and resolutions are set automatically with commercial baselayers in EPSG:3857, such as Google, Bing and OpenStreetMap, and do not need to be specified. Otherwise, if specifying projection, also set maxExtent, maxResolution or resolutions as appropriate. When using vector layers with strategies, layer projection should be set to the projection of the source data if that is different from the map default.
1050
+ *
1051
+ * Can be either a string or an OpenLayers.Projection object; if a string is passed, will be converted to an object when the layer is added to the map.
1052
+ */
1053
+ projection: Projection|string;
1054
+ /** The layer map units. Defaults to null. Possible values are ‘degrees’ (or ‘dd’), ‘m’, ‘ft’, ‘km’, ‘mi’, ‘inches’. Normally taken from the projection. Only required if both map and layers do not define a projection, or if they define a projection which does not define units. */
1055
+ units: string;
1056
+ /** An array of map scales in descending order. The values in the array correspond to the map scale denominator. Note that these values only make sense if the display (monitor) resolution of the client is correctly guessed by whomever is configuring the application. In addition, the units property must also be set. Use resolutions instead wherever possible. */
1057
+ scales: number[];
1058
+ /** A list of map resolutions (map units per pixel) in descending order. If this is not set in the layer constructor, it will be set based on other resolution related properties (maxExtent, maxResolution, maxScale, etc.). */
1059
+ resolutions: number[];
1060
+ /**
1061
+ * If provided as an array, the array should consist of four values (left, bottom, right, top). The maximum extent for the layer. Defaults to null.
1062
+ *
1063
+ * The center of these bounds will not stray outside of the viewport extent during panning. In addition, if displayOutsideMaxExtent is set to false, data will not be requested that falls completely outside of these bounds.
1064
+ */
1065
+ maxExtent?: Bounds|number[];
1066
+ /** If provided as an array, the array should consist of four values (left, bottom, right, top). The minimum extent for the layer. Defaults to null. */
1067
+ minExtent?: Bounds|number[];
1068
+ /** Default max is 360 deg / 256 px, which corresponds to zoom level 0 on gmaps. Specify a different value in the layer options if you are not using the default OpenLayers.Map.tileSize and displaying the whole world. */
1069
+ maxResolution: number;
1070
+ minResolution: number;
1071
+ numZoomLevels: number;
1072
+ minScale: number;
1073
+ maxScale: number;
1074
+ /** Request map tiles that are completely outside of the max extent for this layer. Defaults to false. */
1075
+ displayOutsideMaxExtent?: boolean;
1076
+ /** Wraps the world at the international dateline, so the map can be panned infinitely in longitudinal direction. Only use this on the base layer, and only if the layer’s maxExtent equals the world bounds. #487 for more info. */
1077
+ wrapDateLine: boolean;
1078
+ /**
1079
+ *
1080
+ * @param name The layer name
1081
+ * @param options Hashtable of extra options to tag onto the layer
1082
+ */
1083
+ constructor(name: string, options: object);
1084
+ /**
1085
+ * Sets the new layer name for this layer. Can trigger a changelayer event on the map.
1086
+ * @param newName The new name.
1087
+ */
1088
+ setName(newName: string): void;
1089
+ /**
1090
+ * @param newOptions
1091
+ * @param reinitialize If set to true, and if resolution options of the current baseLayer were changed, the map will be recentered to make sure that it is displayed with a valid resolution, and a changebaselayer event will be triggered.
1092
+ */
1093
+ addOptions(newOptions: object, reinitialize: boolean): void;
1094
+ /**
1095
+ * This function can be implemented by subclasses
1096
+ */
1097
+ onMapResize(): void;
1098
+ /**
1099
+ * Redraws the layer. Returns true if the layer was redrawn, false if not.
1100
+ * @returns The layer was redrawn.
1101
+ */
1102
+ redraw(): boolean;
1103
+ /**
1104
+ * Just as setMap() allows each layer the possibility to take a personalized action on being added to the map, removeMap() allows each layer to take a personalized action on being removed from it. For now, this will be mostly unused, except for the EventPane layer, which needs this hook so that it can remove the special invisible pane.
1105
+ * @param map
1106
+ */
1107
+ removeMap(map: Map): void;
1108
+ /**
1109
+ * @param bounds optional tile bounds, can be used by subclasses that have to deal with different tile sizes at the layer extent edges (e.g. Zoomify)
1110
+ * @returns The size that the image should be, taking into account gutters.
1111
+ */
1112
+ getImageSize(bounds?: Bounds): Size;
1113
+ /**
1114
+ * Set the tile size based on the map size. This also sets layer.imageSize or use by Tile.Image.
1115
+ * @param size
1116
+ */
1117
+ setTileSize(size: Size): void;
1118
+ /**
1119
+ * @returns The layer should be displayed (if in range).
1120
+ */
1121
+ getVisibility(): boolean;
1122
+ /**
1123
+ * Set the visibility flag for the layer and hide/show & redraw accordingly. Fire event unless otherwise specified
1124
+ *
1125
+ * Note that visibility is no longer simply whether or not the layer’s style.display is set to “block”. Now we store a ‘visibility’ state property on the layer class, this allows us to remember whether or not we desire for a layer to be visible. In the case where the map’s resolution is out of the layer’s range, this desire may be subverted.
1126
+ * @param visibility Whether or not to display the layer (if in range)
1127
+ */
1128
+ setVisibility(visibility: boolean): void;
1129
+ /**
1130
+ * Hide or show the Layer. This is designed to be used internally, and is not generally the way to enable or disable the layer. For that, use the setVisibility function instead..
1131
+ * @param display
1132
+ */
1133
+ display(display: boolean): void;
1134
+ /**
1135
+ * @returns The layer is displayable at the current map’s current resolution. Note that if ‘alwaysInRange’ is true for the layer, this function will always return true.
1136
+ */
1137
+ calculateInRange(): boolean;
1138
+ setIsBaseLayer(isBaseLayer: boolean): void;
1139
+ /**
1140
+ * @returns The currently selected resolution of the map, taken from the resolutions array, indexed by current zoom level.
1141
+ */
1142
+ getResolution(): number;
1143
+ /**
1144
+ * @returns A Bounds object which represents the lon/lat bounds of the current viewPort.
1145
+ */
1146
+ getExtent(): Bounds;
1147
+ /**
1148
+ * @param extent
1149
+ * @param closest Find the zoom level that most closely fits the specified bounds. Note that this may result in a zoom that does not exactly contain the entire extent. Default is false.
1150
+ * @returns The index of the zoomLevel (entry in the resolutions array) for the passed-in extent. We do this by calculating the ideal resolution for the given extent (based on the map size) and then calling getZoomForResolution(), passing along the ‘closest’ parameter.
1151
+ */
1152
+ getZoomForExtent(extent: Bounds, closest: boolean): number;
1153
+ /**
1154
+ * @param zoom
1155
+ * @returns A suitable resolution for the specified zoom.
1156
+ */
1157
+ getResolutionForZoom(zoom: number): number;
1158
+ /**
1159
+ * @param extent
1160
+ * @param closest Find the zoom level that corresponds to the absolute closest resolution, which may result in a zoom whose corresponding resolution is actually smaller than we would have desired (if this is being called from a getZoomForExtent() call, then this means that the returned zoom index might not actually contain the entire extent specified... but it’ll be close). Default is false.
1161
+ * @returns The index of the zoomLevel (entry in the resolutions array) that corresponds to the best fit resolution given the passed in value and the ‘closest’ specification.
1162
+ */
1163
+ getZoomForResolution(extent: Bounds, closest: boolean): number;
1164
+ /**
1165
+ * An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the layer.
1166
+ * @param viewPortPx An OpenLayers.Pixel or an object with a ‘x’ and ‘y’ properties.
1167
+ * @returns An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the layer.
1168
+ */
1169
+ getLonLatFromViewPortPx(viewPortPx: Pixel|{x: number, y: number}): LonLat;
1170
+ /**
1171
+ * Returns a pixel location given a map location. This method will return fractional pixel values.
1172
+ * @param lonlat An OpenLayers.LonLat or an object with a ‘lon’ and ‘lat’ properties.
1173
+ * @param resolution
1174
+ * @returns An OpenLayers.Pixel which is the passed-in lonlat translated into view port pixels.
1175
+ */
1176
+ getViewPortPxFromLonLat(lonlat: LonLat, resolution: number): Pixel;
1177
+ /**
1178
+ * Sets the opacity for the entire layer (all images)
1179
+ * @param opacity
1180
+ */
1181
+ setOpacity(opacity: number): void;
1182
+ }
1183
+
1184
+ namespace Layer
1185
+ {
1186
+ export class HTTPRequest extends Layer
1187
+ {
1188
+ events: Events;
1189
+ /** Used to hash URL param strings for multi-WMS server selection. Set to the Golden Ratio per Knuth’s recommendation. */
1190
+ static readonly URL_HASH_FACTOR: number;
1191
+ /**
1192
+ * @deprecated See http://docs.openlayers.org/library/spherical_mercator.html for information on the replacement for this functionality.
1193
+ * Whether layer should reproject itself based on base layer locations. This allows reprojection onto commercial layers. Default is false: Most layers can’t reproject, but layers which can create non-square geographic pixels can, like WMS.
1194
+ */
1195
+ reproject?: boolean;
1196
+ /**
1197
+ * @param name
1198
+ * @param url
1199
+ * @param params
1200
+ * @param options Hashtable of extra options to tag onto the layer
1201
+ */
1202
+ constructor(name: string, url: string|string[], params: object, options: object);
1203
+ destroy(): void;
1204
+ /**
1205
+ *
1206
+ * @param obj
1207
+ * @returns An exact clone of this OpenLayers.Layer.HTTPRequest
1208
+ */
1209
+ clone(obj: object): HTTPRequest;
1210
+ setUrl(newUrl: string): void;
1211
+ /**
1212
+ * @param newParams
1213
+ * @returns whether the layer was actually redrawn.
1214
+ */
1215
+ mergeNewParams(newParams: object): boolean;
1216
+ /**
1217
+ * Redraws the layer. Returns true if the layer was redrawn, false if not.
1218
+ * @param force Force redraw by adding random parameter.
1219
+ * @returns The layer was redrawn.
1220
+ */
1221
+ redraw(force: boolean): boolean;
1222
+ }
1223
+
1224
+ /**
1225
+ * Base class for layers that use a lattice of tiles. Create a new grid layer with the OpenLayers.Layer.Grid constructor.
1226
+ */
1227
+ export class Grid extends HTTPRequest
1228
+ {
1229
+ tileSize: Size;
1230
+ /** Optional origin for aligning the grid of tiles. If provided, requests for tiles at all resolutions will be aligned with this location (no tiles shall overlap this location). If not provided, the grid of tiles will be aligned with the layer’s maxExtent. Default is ``null``. */
1231
+ tileOrigin: LonLat|null;
1232
+ /** optional configuration options for OpenLayers.Tile instances created by this Layer, if supported by the tile class. */
1233
+ tileOptions: object;
1234
+ /** The tile class to use for this layer. Defaults is OpenLayers.Tile.Image. */
1235
+ tileClass: Tile;
1236
+ /** Moves the layer into single-tile mode, meaning that one tile will be loaded. The tile’s size will be determined by the ‘ratio’ property. When the tile is dragged such that it does not cover the entire viewport, it is reloaded. */
1237
+ singleTile: boolean;
1238
+ /** Used only when in single-tile mode, this specifies the ratio of the size of the single tile to the size of the map. Default value is 1.5. */
1239
+ ratio: number;
1240
+ /** Used only when in gridded mode, this specifies the number of extra rows and columns of tiles on each side which will surround the minimum grid tiles to cover the map. For very slow loading layers, a larger value may increase performance somewhat when dragging, but will increase bandwidth use significantly. */
1241
+ buffer: number;
1242
+ /**
1243
+ * The transition effect to use when the map is zoomed. Two possible values:
1244
+ * ”resize” Existing tiles are resized on zoom to provide a visual effect of the zoom having taken place immediately. As the new tiles become available, they are drawn on top of the resized tiles (this is the default setting).
1245
+ * ”map-resize” Existing tiles are resized on zoom and placed below the base layer. New tiles for the base layer will cover existing tiles. This setting is recommended when having an overlay duplicated during the transition is undesirable (e.g. street labels or big transparent fills).
1246
+ * null No transition effect.
1247
+ * Using “resize” on non-opaque layers can cause undesired visual effects. Set transitionEffect to null in this case.
1248
+ */
1249
+ transitionEffect: string;
1250
+ /** How many tiles are still loading? */
1251
+ numLoadingTiles: number;
1252
+ /** Delay for removing the backbuffer when all tiles have finished loading. Can be set to 0 when no css opacity transitions for the olTileImage class are used. Default is 0 for singleTile layers, 2500 for tiled layers. See className for more information on tile animation. */
1253
+ removeBackBufferDelay: number;
1254
+ /** Name of the class added to the layer div. If not set in the options passed to the constructor then className defaults to “olLayerGridSingleTile” for single tile layers (see singleTile), and “olLayerGrid” for non single tile layers. */
1255
+ className: string;
1256
+ /**
1257
+ * Create a new grid layer
1258
+ * @param name
1259
+ * @param url
1260
+ * @param params
1261
+ * @param options Hashtable of extra options to tag onto the layer
1262
+ */
1263
+ constructor(name: string, url: string, params: object, options: object);
1264
+ /** Deconstruct the layer and clear the grid. */
1265
+ destroy(): void;
1266
+ /**
1267
+ * Refetches tiles with new params merged, keeping a backbuffer. Each loading new tile will have a css class of ‘.olTileReplacing’. If a stylesheet applies a ‘display: none’ style to that class, any fade-in transition will not apply, and backbuffers for each tile will be removed as soon as the tile is loaded.
1268
+ * @param newParams
1269
+ * @returns whether the layer was actually redrawn.
1270
+ */
1271
+ mergeNewParams(newParams: object): boolean;
1272
+ /**
1273
+ * @param newOptions
1274
+ * @param reinitialize If set to true, and if resolution options of the current baseLayer were changed, the map will be recentered to make sure that it is displayed with a valid resolution, and a changebaselayer event will be triggered.
1275
+ */
1276
+ addOptions(newOptions: object, reinitialize: boolean): void;
1277
+ /**
1278
+ * Create a clone of this layer
1279
+ * @param obj Is this ever used?
1280
+ * @returns An exact clone of this OpenLayers.Layer.Grid
1281
+ */
1282
+ clone(obj: object): Grid;
1283
+ /**
1284
+ * Check if we are in singleTile mode and if so, set the size as a ratio of the map size (as specified by the layer’s ‘ratio’ property).
1285
+ * @param size
1286
+ */
1287
+ setTileSize(size: Size): void;
1288
+ /**
1289
+ * Return the bounds of the tile grid.
1290
+ * @returns A Bounds object representing the bounds of all the currently loaded tiles (including those partially or not at all seen onscreen).
1291
+ */
1292
+ getTilesBounds(): Bounds;
1293
+ /**
1294
+ * Create a tile, initialize it, and add it to the layer div.
1295
+ * @param bounds
1296
+ * @param position
1297
+ * @returns The added OpenLayers.Tile
1298
+ */
1299
+ addTile(bounds: Bounds, position: Pixel): void;
1300
+ /**
1301
+ * Returns The tile bounds for a layer given a pixel location.
1302
+ * @param viewPortPx The location in the viewport.
1303
+ * @returns Bounds of the tile at the given pixel location.
1304
+ */
1305
+ getTileBounds(viewPortPx: Pixel): Bounds;
1306
+ }
1307
+
1308
+ export class XYZ extends Grid
1309
+ {
1310
+ /** Default is true, as this is designed to be a base tile source. */
1311
+ isBaseLayer: boolean;
1312
+ /** Whether the tile extents should be set to the defaults for spherical mercator. Useful for things like OpenStreetMap. Default is false, except for the OSM subclass. */
1313
+ sphericalMercator: boolean;
1314
+ /** If your cache has more zoom levels than you want to provide access to with this layer, supply a zoomOffset. This zoom offset is added to the current map zoom level to determine the level for a requested tile. For example, if you supply a zoomOffset of 3, when the map is at the zoom 0, tiles will be requested from level 3 of your cache. Default is 0 (assumes cache level and map zoom are equivalent). Using zoomOffset is an alternative to setting serverResolutions if you only want to expose a subset of the server resolutions. */
1315
+ zoomOffset: number;
1316
+ /** A list of all resolutions available on the server. Only set this property if the map resolutions differ from the server. This property serves two purposes. (a) serverResolutions can include resolutions that the server supports and that you don’t want to provide with this layer; you can also look at zoomOffset, which is an alternative to serverResolutions for that specific purpose. (b) The map can work with resolutions that aren’t supported by the server, i.e. that aren’t in serverResolutions. When the map is displayed in such a resolution data for the closest server-supported resolution is loaded and the layer div is stretched as necessary. */
1317
+ serverResolutions: number[];
1318
+ /**
1319
+ *
1320
+ * @param name
1321
+ * @param url
1322
+ * @param options Hashtable of extra options to tag onto the layer
1323
+ */
1324
+ constructor(name: string, url: string, options: object);
1325
+ /**
1326
+ * Create a clone of this layer
1327
+ * @param obj Is this ever used?
1328
+ * @returns An exact clone of this OpenLayers.Layer.XYZ
1329
+ */
1330
+ clone(obj: object): XYZ;
1331
+ /**
1332
+ * When the layer is added to a map, then we can fetch our origin (if we don’t have one.)
1333
+ * @param map
1334
+ */
1335
+ setMap(map: Map): void;
1336
+ }
1337
+
1338
+ /**
1339
+ * This layer allows accessing OpenStreetMap tiles. By default the OpenStreetMap hosted tile.openstreetmap.org Mapnik tileset is used. If you wish to use a different layer instead, you need to provide a different URL to the constructor. Here’s an example for using OpenCycleMap:
1340
+ */
1341
+ export class OSM extends XYZ
1342
+ {
1343
+ /** The layer name. Defaults to “OpenStreetMap” if the first argument to the constructor is null or undefined. */
1344
+ name: string;
1345
+ /**
1346
+ * The tileset URL scheme. Defaults to (protocol relative url)
1347
+ * [a|b|c].tile.openstreetmap.org/${z}/${x}/${y}.png (the official OSM tileset) if the second argument to the constructor is null or undefined. To use another tileset you can have something like this:
1348
+ */
1349
+ url: string;
1350
+ /** optional configuration options for OpenLayers.Tile instances created by this Layer. Default is */
1351
+ tileOptions: object;
1352
+ /**
1353
+ * @param name The layer name.
1354
+ * @param url The tileset URL scheme.
1355
+ * @param options Configuration options for the layer. Any inherited layer option can be set in this object (e.g. OpenLayers.Layer.Grid.buffer).
1356
+ */
1357
+ constructor(name: string, url: string|string[], options?: object);
1358
+ }
1359
+
1360
+ /**
1361
+ * Instances of OpenLayers.Layer.ArcGIS93Rest are used to display data from ESRI ArcGIS Server 9.3 (and up?) Mapping Services using the REST API. Create a new ArcGIS93Rest layer with the OpenLayers.Layer.ArcGIS93Rest constructor. More detail on the REST API is available at http://sampleserver1.arcgisonline.com/ArcGIS/SDK/REST/index.html ; specifically, the URL provided to this layer should be an export service URL: http://sampleserver1.arcgisonline.com/ArcGIS/SDK/REST/export.html
1362
+ */
1363
+ export class ArcGIS93Rest extends Grid
1364
+ {
1365
+ /** Hashtable of default parameter key/value pairs */
1366
+ static readonly DEFAULT_PARAMS: object;
1367
+ /** Default is true for ArcGIS93Rest layer */
1368
+ isBaseLayer: boolean;
1369
+ /**
1370
+ * Create a new ArcGIS93Rest layer object.
1371
+ * @param name A name for the layer
1372
+ * @param url Base url for the ArcGIS server REST service
1373
+ * @param params An object with key/value pairs representing the query string parameters and values.
1374
+ * @param options Hashtable of extra options to tag onto the layer.
1375
+ */
1376
+ constructor(name: string, url: string|string[], params?: object, options?: object);
1377
+ /**
1378
+ * Catch changeParams and uppercase the new params to be merged in before calling changeParams on the super class.
1379
+ *
1380
+ * Once params have been changed, the tiles will be reloaded with the new parameters.
1381
+ * @param newParams Hashtable of new params to use
1382
+ */
1383
+ mergeNewParams(newParams: object): boolean;
1384
+ }
1385
+
1386
+ /**
1387
+ * Instances of OpenLayers.Layer.WMS are used to display data from OGC Web Mapping Services. Create a new WMS layer with the OpenLayers.Layer.WMS constructor.
1388
+ */
1389
+ export class WMS extends Grid
1390
+ {
1391
+ /** Hashtable of default parameter key/value pairs */
1392
+ static readonly DEFAULT_PARAMS: object;
1393
+ /** Default is true for WMS layer */
1394
+ isBaseLayer: boolean;
1395
+ /** Should the BBOX commas be encoded? The WMS spec says ‘no’, but some services want it that way. Default false. */
1396
+ encodeBBOX: boolean;
1397
+ /** If true, the image format will not be automagicaly switched from image/jpeg to image/png or image/gif when using TRANSPARENT=TRUE. Also isBaseLayer will not changed by the constructor. Default false. */
1398
+ noMagic: boolean;
1399
+ /**
1400
+ * Create a new WMS layer object
1401
+ *
1402
+ * The code below creates a simple WMS layer using the image/jpeg format.
1403
+ *
1404
+ * Note the 3rd argument (params). Properties added to this object will be added to the WMS GetMap requests used for this layer’s tiles. The only mandatory parameter is “layers”. Other common WMS params include “transparent”, “styles” and “format”. Note that the “srs” param will always be ignored. Instead, it will be derived from the baseLayer’s or map’s projection.
1405
+ * The code below creates a transparent WMS layer with additional options.
1406
+ *
1407
+ * Note that by default, a WMS layer is configured as baseLayer. Setting the “transparent” param to true will apply some magic (see noMagic). The default image format changes from image/jpeg to image/png, and the layer is not configured as baseLayer.
1408
+ * @param name A name for the layer
1409
+ * @param url Base url for the WMS (e.g. http://wms.jpl.nasa.gov/wms.cgi)
1410
+ * @param params An object with key/value pairs representing the GetMap query string parameters and parameter values.
1411
+ * @param objects Hashtable of extra options to tag onto the layer. These options include all properties listed above, plus the ones inherited from superclasses.
1412
+ */
1413
+ constructor(name: string, url: string, params?: object, objects?: object);
1414
+ /**
1415
+ * Returns true if the axis order is reversed for the WMS version and projection of the layer.
1416
+ * @returns true if the axis order is reversed, false otherwise.
1417
+ */
1418
+ reverseAxisOrder(): boolean;
1419
+ /**
1420
+ * Catch changeParams and uppercase the new params to be merged in before calling changeParams on the super class.
1421
+ *
1422
+ * Once params have been changed, the tiles will be reloaded with the new parameters.
1423
+ * @param newParams Hashtable of new params to use
1424
+ */
1425
+ mergeNewParams(newParams: object): boolean;
1426
+ /**
1427
+ * Combine the layer’s url with its params and these newParams.
1428
+ *
1429
+ * Add the SRS parameter from projection -- this is probably more eloquently done via a setProjection() method, but this works for now and always.
1430
+ * @param newParams
1431
+ * @param altUrl Use this as the url instead of the layer’s url
1432
+ */
1433
+ getFullRequestString(newParams: object, altUrl: string): string;
1434
+ }
1435
+
1436
+ /**
1437
+ * Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources. Create a new vector layer with the OpenLayers.Layer.Vector constructor.
1438
+ */
1439
+ export class Vector extends Layer
1440
+ {
1441
+ /**
1442
+ * Listeners will be called with a reference to an event object. The properties of this event depends on exactly what happened.
1443
+ */
1444
+ events: Events;
1445
+ /** The layer is a base layer. Default is false. Set this property in the layer options. */
1446
+ isBaseLayer: boolean;
1447
+ /** Whether the layer remains in one place while dragging the map. Note that setting this to true will move the layer to the bottom of the layer stack. */
1448
+ isFixed: boolean;
1449
+ features: Feature.Vector[];
1450
+ /** report friendly error message when loading of renderer fails. */
1451
+ reportError: boolean;
1452
+ /** Default style for the layer */
1453
+ style: object;
1454
+ /** Options for the renderer. See {OpenLayers.Renderer} for supported options. */
1455
+ rendererOptions: object;
1456
+ /** geometryType allows you to limit the types of geometries this layer supports. This should be set to something like “OpenLayers.Geometry.Point” to limit types. */
1457
+ geometryType: string;
1458
+ /** This specifies the ratio of the size of the visiblity of the Vector Layer features to the size of the map. */
1459
+ ratio: number;
1460
+ /**
1461
+ * Create a new vector layer
1462
+ * @param name A name for the layer
1463
+ * @param options Optional object with non-default properties to set on the layer.
1464
+ */
1465
+ constructor(name: string, options?: object);
1466
+ /**
1467
+ * Destroy this layer
1468
+ */
1469
+ destroy(): void;
1470
+ /**
1471
+ * Hide or show the Layer
1472
+ * @param display
1473
+ */
1474
+ display(display: boolean): void;
1475
+ /**
1476
+ * Add Features to the layer.
1477
+ * @param features
1478
+ * @param options
1479
+ */
1480
+ addFeatures(features: Feature.Vector[], options?: object): void;
1481
+ /**
1482
+ * Remove features from the layer. This erases any drawn features and removes them from the layer’s control. The beforefeatureremoved and featureremoved events will be triggered for each feature. The featuresremoved event will be triggered after all features have been removed. To suppress event triggering, use the silent option.
1483
+ * @param features List of features to be removed.
1484
+ * @param options Optional properties for changing behavior of the removal.
1485
+ */
1486
+ removeFeatures(features: Feature.Vector[], options?: object): void;
1487
+ /**
1488
+ * Remove all features from the layer.
1489
+ * @param options Optional properties for changing behavior of the removal.
1490
+ */
1491
+ removeAllFeatures(options?: object): void;
1492
+ /**
1493
+ * Erase and destroy features on the layer.
1494
+ * @param features An optional array of features to destroy. If not supplied, all features on the layer will be destroyed.
1495
+ * @param options
1496
+ */
1497
+ destroyFeatures(features: Feature.Vector[], options?: object): void;
1498
+ /**
1499
+ * Draw (or redraw) a feature on the layer. If the optional style argument is included, this style will be used. If no style is included, the feature’s style will be used. If the feature doesn’t have a style, the layer’s style will be used.
1500
+ *
1501
+ * This function is not designed to be used when adding features to the layer (use addFeatures instead). It is meant to be used when the style of a feature has changed, or in some other way needs to visually updated after it has already been added to a layer. You must add the feature to the layer for most layer-related events to happen.
1502
+ * @param feature
1503
+ * @param style Named render intent or full symbolizer object.
1504
+ */
1505
+ drawFeature(feature: Feature.Vector, style: string|object): void;
1506
+ /**
1507
+ * Given a property value, return the feature if it exists in the features array
1508
+ * @param property
1509
+ * @param value
1510
+ * @returns A feature corresponding to the given property value or null if there is no such feature.
1511
+ */
1512
+ getFeatureBy(property: string, value: string): Feature.Vector|null;
1513
+ /**
1514
+ * Given a feature id, return the feature if it exists in the features array
1515
+ * @param featureId
1516
+ * @returns A feature corresponding to the given featureId or null if there is no such feature.
1517
+ */
1518
+ getFeatureById(featureId: string): Feature.Vector|null;
1519
+ /**
1520
+ * Given a feature fid, return the feature if it exists in the features array
1521
+ * @param featureFid
1522
+ * @returns A feature corresponding to the given featureFid or null if there is no such feature.
1523
+ */
1524
+ getFeatureByFid(featureFid: string): Feature.Vector|null;
1525
+ /**
1526
+ * Returns an array of features that have the given attribute key set to the given value. Comparison of attribute values takes care of datatypes, e.g. the string ‘1234’ is not equal to the number 1234.
1527
+ * @param attrName
1528
+ * @param attrValue
1529
+ * @returns An array of features that have the passed named attribute set to the given value.
1530
+ */
1531
+ getFeaturesByAttribute(attrName: string, attrValue: string): Feature.Vector[]|null;
1532
+ /**
1533
+ * method called after a feature is inserted. Does nothing by default. Override this if you need to do something on feature updates.
1534
+ * @param feature
1535
+ */
1536
+ onFeatureInsert(feature: Feature.Vector): void;
1537
+ /**
1538
+ * method called before a feature is inserted. Does nothing by default. Override this if you need to do something when features are first added to the layer, but before they are drawn, such as adjust the style.
1539
+ * @param feature
1540
+ */
1541
+ preFeatureInsert(feature: Feature.Vector): void;
1542
+ /**
1543
+ * Calculates the max extent which includes all of the features.
1544
+ * @returns or null if the layer has no features with geometries.
1545
+ */
1546
+ getDataExtent(): Bounds|null;
1547
+ }
1548
+
1549
+ export class Markers extends Layer
1550
+ {
1551
+ /** Markers layer is never a base layer. */
1552
+ isBaseLayer: boolean;
1553
+ /** internal marker list */
1554
+ markers: Marker[];
1555
+ /**
1556
+ * Create a Markers layer.
1557
+ * @param name
1558
+ * @param options Hashtable of extra options to tag onto the layer
1559
+ */
1560
+ constructor(name: string, options?: object);
1561
+ destroy(): void;
1562
+ /**
1563
+ * Sets the opacity for all the markers.
1564
+ * @param opacity
1565
+ */
1566
+ setOpacity(opacity: number): void;
1567
+ addMarker(marker: Marker): void;
1568
+ removeMarker(marker: Marker): void;
1569
+ /**
1570
+ * Calculates the max extent which includes all of the markers.
1571
+ */
1572
+ getDataExtent(): Bounds;
1573
+ }
1574
+ }
1575
+
1576
+ /**
1577
+ * This class represents a longitude and latitude pair
1578
+ */
1579
+ export class LonLat
1580
+ {
1581
+ /** The x-axis coodinate in map units */
1582
+ lon: number;
1583
+ /** The y-axis coordinate in map units */
1584
+ lat: number;
1585
+ /**
1586
+ * Create a new map location. Coordinates can be passed either as two arguments, or as a single argument.
1587
+ * @param lon The x-axis coordinate in map units. If your map is in a geographic projection, this will be the Longitude. Otherwise, it will be the x coordinate of the map location in your map units.
1588
+ * @param lat The y-axis coordinate in map units. If your map is in a geographic projection, this will be the Latitude. Otherwise, it will be the y coordinate of the map location in your map units.
1589
+ */
1590
+ constructor(lon: number, lat: number);
1591
+ /**
1592
+ * @returns Shortened String representation of OpenLayers.LonLat object. (e.g. <i>”5, 42”</i>)
1593
+ */
1594
+ toShortString(): string;
1595
+ /**
1596
+ * @returns New OpenLayers.LonLat object with the same lon and lat values
1597
+ */
1598
+ clone(): LonLat;
1599
+ /**
1600
+ *
1601
+ * @param lon
1602
+ * @param lat
1603
+ * @returns A new OpenLayers.LonLat object with the lon and lat passed-in added to this’s.
1604
+ */
1605
+ add(lon: number, lat: number): LonLat;
1606
+ /**
1607
+ *
1608
+ * @param ll
1609
+ * @returns Boolean value indicating whether the passed-in OpenLayers.LonLat object has the same lon and lat components as this. Note: if ll passed in is null, returns false
1610
+ */
1611
+ equals(ll: LonLat|null):boolean;
1612
+ /**
1613
+ * Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.
1614
+ * @param source Source projection.
1615
+ * @param dest Destination projection.
1616
+ * @returns Itself, for use in chaining operations.
1617
+ */
1618
+ transform(source: Projection, dest: Projection): LonLat;
1619
+ /**
1620
+ *
1621
+ * @param maxExtent
1622
+ * @returns A copy of this lonlat, but wrapped around the “dateline” (as specified by the borders of maxExtent)
1623
+ */
1624
+ wrapDateLine(maxExtent: Bounds): LonLat;
1625
+ }
1626
+
1627
+ /**
1628
+ * Instances of OpenLayers.Map are interactive maps embedded in a web page. Create a new map with the OpenLayers.Map constructor.
1629
+ *
1630
+ * On their own maps do not provide much functionality. To extend a map it’s necessary to add controls (OpenLayers.Control) and layers (OpenLayers.Layer) to the map.
1631
+ */
1632
+ export class Map
1633
+ {
1634
+ /** Base z-indexes for different classes of thing */
1635
+ static readonly Z_INDEX_BASE: object;
1636
+ /** An events object that handles all events on the map */
1637
+ events: Events;
1638
+ /**
1639
+ * Allow the map to function with “overlays” only. Defaults to false. If true, the lowest layer in the draw order will act as the base layer. In addition, if set to true, all layers will have isBaseLayer set to false when they are added to the map.
1640
+ *
1641
+ * If you set map.allOverlays to true, then you cannot use map.setBaseLayer or layer.setIsBaseLayer. With allOverlays true, the lowest layer in the draw layer is the base layer. So, to change the base layer, use setLayerIndex or raiseLayer to set the layer index to 0.
1642
+ */
1643
+ allOverlays: boolean;
1644
+ /**
1645
+ * The element that contains the map (or an id for that element). If the OpenLayers.Map constructor is called with two arguments, this should be provided as the first argument. Alternatively, the map constructor can be called with the options object as the only argument. In this case (one argument), a div property may or may not be provided. If the div property is not provided, the map can be rendered to a container later using the render method.
1646
+ *
1647
+ * If you are calling render after map construction, do not use maxResolution auto. Instead, divide your maxExtent by your maximum expected dimension.
1648
+ */
1649
+ div: HTMLElement|string;
1650
+ /** Ordered list of layers in the map */
1651
+ layers: Layer[];
1652
+ /**
1653
+ * List of controls associated with the map.
1654
+ *
1655
+ * If not provided in the map options at construction, the map will by default be given the following controls if present in the build:
1656
+ */
1657
+ controls: Control[];
1658
+ /** The currently selected base layer. This determines min/max zoom level, projection, etc. */
1659
+ baseLayer: Layer;
1660
+ /** The options object passed to the class constructor. Read-only. */
1661
+ options: object;
1662
+ /** Set in the map options to override the default tile size for this map. */
1663
+ tileSize: Size;
1664
+ /** Set in the map options to specify the default projection for layers added to this map. When using a projection other than EPSG:4326 (CRS:84, Geographic) or EPSG:3857 (EPSG:900913, Web Mercator), also set maxExtent, maxResolution or resolutions. Default is “EPSG:4326”. Note that the projection of the map is usually determined by that of the current baseLayer (see baseLayer and getProjectionObject). */
1665
+ projection: string;
1666
+ /** The map units. Possible values are ‘degrees’ (or ‘dd’), ‘m’, ‘ft’, ‘km’, ‘mi’, ‘inches’. Normally taken from the projection. Only required if both map and layers do not define a projection, or if they define a projection which does not define units */
1667
+ units: string;
1668
+ /** A list of map resolutions (map units per pixel) in descending order. If this is not set in the layer constructor, it will be set based on other resolution related properties (maxExtent, maxResolution, maxScale, etc.). */
1669
+ resolutions: number[];
1670
+ /** Required if you are not displaying the whole world on a tile with the size specified in tileSize. */
1671
+ maxResolution: number;
1672
+ minResolution: number;
1673
+ maxScale: number;
1674
+ minScale: number;
1675
+ /** If provided as an array, the array should consist of four values (left, bottom, right, top). The maximum extent for the map. Default depends on projection; if this is one of those defined in OpenLayers.Projection.defaults (EPSG:4326 or web mercator), maxExtent will be set to the value defined there; else, defaults to null. To restrict user panning and zooming of the map, use restrictedExtent instead. The value for maxExtent will change calculations for tile URLs. */
1676
+ maxExtent: Bounds|number[];
1677
+ /** If provided as an array, the array should consist of four values (left, bottom, right, top). The minimum extent for the map. Defaults to null. */
1678
+ minExtent: Bounds|number[]|null;
1679
+ /** If provided as an array, the array should consist of four values (left, bottom, right, top). Limit map navigation to this extent where possible. If a non-null restrictedExtent is set, panning will be restricted to the given bounds. In addition, zooming to a resolution that displays more than the restricted extent will center the map on the restricted extent. If you wish to limit the zoom level or resolution, use maxResolution. */
1680
+ restrictedExtent: Bounds|number[];
1681
+ /** Number of zoom levels for the map. Defaults to 16. Set a different value in the map options if needed. */
1682
+ numZoomLevels: number;
1683
+ /** Relative path to a CSS file from which to load theme styles. Specify null in the map options (e.g. {theme: null}) if you want to get cascading style declarations - by putting links to stylesheets or style declarations directly in your page. */
1684
+ theme: string;
1685
+ /** Requires proj4js support for projections other than EPSG:4326 or EPSG:900913/EPSG:3857. Projection used by several controls to display data to user. If this property is set, it will be set on any control which has a null displayProjection property at the time the control is added to the map. */
1686
+ displayProjection: Projection;
1687
+ /** By default, and if the build contains TileManager.js, the map will use the TileManager to queue image requests and to cache tile image elements. To create a map without a TileManager configure the map with tileManager: null. To create a TileManager with non-default options, supply the options instead or alternatively supply an instance of {OpenLayers.TileManager}. */
1688
+ tileManager: TileManager|object;
1689
+ /** Should OpenLayers allow events on the map to fall through to other elements on the page, or should it swallow them? (#457) Default is to swallow. */
1690
+ fallThrough: boolean;
1691
+ /** Should OpenLayers automatically update the size of the map when the resize event is fired. Default is true. */
1692
+ autoUpdateSize: boolean;
1693
+ /** If set as an option at construction, the eventListeners object will be registered with OpenLayers.Events.on. Object structure must be a listeners object as shown in the example for the events.on method. */
1694
+ eventListeners: object;
1695
+ /** The Easing function to be used for tweening. Default is OpenLayers.Easing.Expo.easeOut. Setting this to ‘null’ turns off animated panning. */
1696
+ panMethod: Function;
1697
+ /** The Easing function to be used for tweening. Default is OpenLayers.Easing.Quad.easeOut. Setting this to ‘null’ turns off animated zooming. */
1698
+ zoomMethod: Function;
1699
+ /**
1700
+ * Constructor for a new OpenLayers.Map instance. There are two possible ways to call the map constructor. See the examples below.
1701
+ * @param div The element or id of an element in your page that will contain the map. May be omitted if the div option is provided or if you intend to call the render method later.
1702
+ * @param options Optional object with properties to tag onto the map.
1703
+ */
1704
+ constructor(div: HTMLElement|string, options?: object);
1705
+ /**
1706
+ * Get the DOMElement representing the view port.
1707
+ */
1708
+ getViewport(): HTMLElement;
1709
+ /**
1710
+ * Render the map to a specified container.
1711
+ * @param div The container that the map should be rendered to. If different than the current container, the map viewport will be moved from the current to the new container.
1712
+ */
1713
+ render(div: string|HTMLElement): void;
1714
+ /**
1715
+ * Destroy this map. Note that if you are using an application which removes a container of the map from the DOM, you need to ensure that you destroy the map before this happens; otherwise, the page unload handler will fail because the DOM elements that map.destroy() wants to clean up will be gone.
1716
+ */
1717
+ destroy(): void;
1718
+ /**
1719
+ * Change the map options
1720
+ * @param options Hashtable of options to tag to the map
1721
+ */
1722
+ setOptions(options: object): void;
1723
+ /**
1724
+ * Get the tile size for the map
1725
+ */
1726
+ getTileSize(): Size;
1727
+ /**
1728
+ * Get a list of objects given a property and a match item.
1729
+ * @param array A property on the map whose value is an array.
1730
+ * @param property A property on each item of the given array.
1731
+ * @param match A string to match. Can also be a regular expression literal or object. In addition, it can be any object with a method named test. For reqular expressions or other, if match.test(map[array][i][property]) evaluates to true, the item will be included in the array returned. If no items are found, an empty array is returned.
1732
+ * @returns An array of items where the given property matches the given criteria.
1733
+ */
1734
+ getBy(array: string, property: string, match: string|object): Array;
1735
+ /**
1736
+ * Get a list of layers with properties matching the given criteria.
1737
+ * @param property A layer property to be matched.
1738
+ * @param match A string to match. Can also be a regular expression literal or object. In addition, it can be any object with a method named test. For reqular expressions or other, if match.test(layer[property]) evaluates to true, the layer will be included in the array returned. If no layers are found, an empty array is returned.
1739
+ * @returns A list of layers matching the given criteria. An empty array is returned if no matches are found.
1740
+ */
1741
+ getLayersBy(property: string, match: string|object): Layer[];
1742
+ /**
1743
+ * Get a list of layers with names matching the given name.
1744
+ * @param match A layer name. The name can also be a regular expression literal or object. In addition, it can be any object with a method named test. For reqular expressions or other, if name.test(layer.name) evaluates to true, the layer will be included in the list of layers returned. If no layers are found, an empty array is returned.
1745
+ * @returns A list of layers matching the given name. An empty array is returned if no matches are found.
1746
+ */
1747
+ getLayersByName(match: string|object): Layer[];
1748
+ /**
1749
+ * Get a list of layers of a given class (CLASS_NAME).
1750
+ * @param match A layer class name. The match can also be a regular expression literal or object. In addition, it can be any object with a method named test. For reqular expressions or other, if type.test(layer.CLASS_NAME) evaluates to true, the layer will be included in the list of layers returned. If no layers are found, an empty array is returned.
1751
+ * @returns A list of layers matching the given class. An empty array is returned if no matches are found.
1752
+ */
1753
+ getLayersByClass(match: string|object): Layer[];
1754
+ /**
1755
+ * Get a list of controls with properties matching the given criteria.
1756
+ * @param property A control property to be matched.
1757
+ * @param match A string to match. Can also be a regular expression literal or object. In addition, it can be any object with a method named test. For reqular expressions or other, if match.test(layer[property]) evaluates to true, the layer will be included in the array returned. If no layers are found, an empty array is returned.
1758
+ * @returns A list of controls matching the given criteria. An empty array is returned if no matches are found.
1759
+ */
1760
+ getControlsBy(property: string, match: string|object): Control[];
1761
+ /**
1762
+ * Get a list of controls of a given class (CLASS_NAME).
1763
+ * @param match A control class name. The match can also be a regular expression literal or object. In addition, it can be any object with a method named test. For reqular expressions or other, if type.test(control.CLASS_NAME) evaluates to true, the control will be included in the list of controls returned. If no controls are found, an empty array is returned.
1764
+ * @returns A list of controls matching the given class. An empty array is returned if no matches are found.
1765
+ */
1766
+ getControlsByClass(match: string|object): Control[];
1767
+ /**
1768
+ * Get a layer based on its id
1769
+ * @param id A layer id
1770
+ * @returns The Layer with the corresponding id from the map’s layer collection, or null if not found.
1771
+ */
1772
+ getLayer(id: string): Layer|null;
1773
+ /**
1774
+ * @param layer
1775
+ * @returns True if the layer has been added to the map.
1776
+ */
1777
+ addLayer(layer: Layer): boolean;
1778
+ addLayers(layers: Layer[]): void;
1779
+ /**
1780
+ * Removes a layer from the map by removing its visual element (the layer.div property), then removing it from the map’s internal list of layers, setting the layer’s map property to null.
1781
+ *
1782
+ * a “removelayer” event is triggered.
1783
+ *
1784
+ * very worthy of mention is that simply removing a layer from a map will not cause the removal of any popups which may have been created by the layer. this is due to the fact that it was decided at some point that popups would not belong to layers. thus there is no way for us to know here to which layer the popup belongs.
1785
+ *
1786
+ * A simple solution to this is simply to call destroy() on the layer. the default OpenLayers.Layer class’s destroy() function automatically takes care to remove itself from whatever map it has been attached to.
1787
+ *
1788
+ * The correct solution is for the layer itself to register an event-handler on “removelayer” and when it is called, if it recognizes itself as the layer being removed, then it cycles through its own personal list of popups, removing them from the map.
1789
+ * @param layer
1790
+ * @param setNewBaseLayer Default is true
1791
+ */
1792
+ removeLayer(layer: Layer, setNewBaseLayer?: boolean): void;
1793
+ /**
1794
+ * @returns The number of layers attached to the map.
1795
+ */
1796
+ getNumLayers(): number;
1797
+ /**
1798
+ * @param layer
1799
+ * @returns The current (zero-based) index of the given layer in the map’s layer stack. Returns -1 if the layer isn’t on the map.
1800
+ */
1801
+ getLayerIndex(layer: Layer): number;
1802
+ /**
1803
+ * Move the given layer to the specified (zero-based) index in the layer list, changing its z-index in the map display. Use map.getLayerIndex() to find out the current index of a layer. Note that this cannot (or at least should not) be effectively used to raise base layers above overlays.
1804
+ * @param layer
1805
+ * @param idx
1806
+ */
1807
+ setLayerIndex(layer: Layer, idx: number): void;
1808
+ /**
1809
+ * Change the index of the given layer by delta. If delta is positive, the layer is moved up the map’s layer stack; if delta is negative, the layer is moved down. Again, note that this cannot (or at least should not) be effectively used to raise base layers above overlays.
1810
+ * @param layer
1811
+ * @param delta
1812
+ */
1813
+ raiseLayer(layer: Layer, delta: number): void;
1814
+ /**
1815
+ * Allows user to specify one of the currently-loaded layers as the Map’s new base layer.
1816
+ * @param newBaseLayer
1817
+ */
1818
+ setBaseLayer(newBaseLayer: Layer): void;
1819
+ /**
1820
+ * Add the passed over control to the map. Optionally position the control at the given pixel.
1821
+ * @param control
1822
+ * @param px
1823
+ */
1824
+ addControl(control: Control, px?: Pixel): void;
1825
+ /**
1826
+ * Add all of the passed over controls to the map. You can pass over an optional second array with pixel-objects to position the controls. The indices of the two arrays should match and you can add null as pixel for those controls you want to be autopositioned.
1827
+ * @param controls
1828
+ * @param pixels
1829
+ */
1830
+ addControls(controls: Control[], pixels: Pixel[]): void;
1831
+ /**
1832
+ *
1833
+ * @param id ID of the control to return.
1834
+ * @returns The control from the map’s list of controls which has a matching ‘id’. If none found, returns null.
1835
+ */
1836
+ getControl(id: string): Control|null;
1837
+ /**
1838
+ * Remove a control from the map. Removes the control both from the map object’s internal array of controls, as well as from the map’s viewPort (assuming the control was not added outsideViewport)
1839
+ * @param control The control to remove.
1840
+ */
1841
+ removeControl(control: Control): void;
1842
+ /**
1843
+ * @param popup
1844
+ * @param exclusive If true, closes all other popups first
1845
+ */
1846
+ addPopup(popup: Popup, exclusive: boolean): void;
1847
+ removePopup(popup: Popup): void;
1848
+ /**
1849
+ * @returns An OpenLayers.Size object that represents the size, in pixels, of the div into which OpenLayers has been loaded. Note - A clone() of this locally cached variable is returned, so as not to allow users to modify it.
1850
+ */
1851
+ getSize(): Size;
1852
+ /**
1853
+ * This function should be called by any external code which dynamically changes the size of the map div (because mozilla wont let us catch the “onresize” for an element)
1854
+ */
1855
+ updateSize(): void;
1856
+ getCenter(): LonLat;
1857
+ getZoom(): number;
1858
+ /**
1859
+ * Allows user to pan by a value of screen pixels
1860
+ * @param dx
1861
+ * @param dy
1862
+ * @param options Options to configure panning:
1863
+ */
1864
+ pan(dx: number, dy: number, options?: object): void;
1865
+ /**
1866
+ * Allows user to pan to a new lonlat. If the new lonlat is in the current extent the map will slide smoothly
1867
+ * @param lonlat
1868
+ */
1869
+ panTo(lonlat: LonLat): void;
1870
+ /**
1871
+ * Set the map center (and optionally, the zoom level).
1872
+ * @param lonlat The new center location. If provided as array, the first value is the x coordinate, and the 2nd value is the y coordinate.
1873
+ * @param zoom Optional zoom level.
1874
+ * @param dragging Specifies whether or not to trigger movestart/end events
1875
+ * @param forceZoomChange Specifies whether or not to trigger zoom change events (needed on baseLayer change)
1876
+ */
1877
+ setCenter(lonlat: LonLat, zoom: number, dragging: boolean, forceZoomChange: boolean): void;
1878
+ /**
1879
+ * Returns the minimum zoom level for the current map view. If the base layer is configured with <wrapDateLine> set to true, this will be the first zoom level that shows no more than one world width in the current map viewport. Components that rely on this value (e.g. zoom sliders) should also listen to the map’s “updatesize” event and call this method in the “updatesize” listener.
1880
+ * @returns Minimum zoom level that shows a map not wider than its baseLayer’s maxExtent. This is an Integer value, unless the map is configured with <fractionalZoom> set to true.
1881
+ */
1882
+ getMinZoom(): number;
1883
+ /**
1884
+ * This method returns a string representing the projection. In the case of projection support, this will be the srsCode which is loaded -- otherwise it will simply be the string value that was passed to the projection at startup.
1885
+ *
1886
+ * FIXME: In 3.0, we will remove getProjectionObject, and instead return a Projection object from this function.
1887
+ * @returns The Projection string from the base layer or null.
1888
+ */
1889
+ getProjection(): string;
1890
+ /**
1891
+ * Returns the projection obect from the baselayer.
1892
+ * @returns The Projection of the base layer.
1893
+ */
1894
+ getProjectionObject(): Projection;
1895
+ /**
1896
+ * @returns The Map’s Maximum Resolution
1897
+ */
1898
+ getMaxResolution(): string;
1899
+ /**
1900
+ *
1901
+ * @param options
1902
+ * @returns The maxExtent property as set on the current baselayer, unless the ‘restricted’ option is set, in which case the ‘restrictedExtent’ option from the map is returned (if it is set).
1903
+ */
1904
+ getMaxExtent(options: object): Bounds;
1905
+ /**
1906
+ * @returns The total number of zoom levels that can be displayed by the current baseLayer.
1907
+ */
1908
+ getNumZoomLevels(): number;
1909
+ /**
1910
+ * @returns A Bounds object which represents the lon/lat bounds of the current viewPort. If no baselayer is set, returns null.
1911
+ */
1912
+ getExtent(): Bounds;
1913
+ /**
1914
+ * @returns The current resolution of the map. If no baselayer is set, returns null.
1915
+ */
1916
+ getResolution(): number;
1917
+ /**
1918
+ * @returns The current units of the map. If no baselayer is set, returns null.
1919
+ */
1920
+ getUnits(): number;
1921
+ /**
1922
+ * @returns The current scale denominator of the map. If no baselayer is set, returns null.
1923
+ */
1924
+ getScale(): number;
1925
+ /**
1926
+ *
1927
+ * @param bounds
1928
+ * @param closest Find the zoom level that most closely fits the specified bounds. Note that this may result in a zoom that does not exactly contain the entire extent. Default is false.
1929
+ * @returns A suitable zoom level for the specified bounds. If no baselayer is set, returns null.
1930
+ */
1931
+ getZoomForExtent(bounds: Bounds, closest: boolean): number;
1932
+ /**
1933
+ *
1934
+ * @param zoom
1935
+ * @returns A suitable resolution for the specified zoom. If no baselayer is set, returns null.
1936
+ */
1937
+ getResolutionForZoom(zoom: number): number;
1938
+ /**
1939
+ *
1940
+ * @param resolution
1941
+ * @param closest Find the zoom level that corresponds to the absolute closest resolution, which may result in a zoom whose corresponding resolution is actually smaller than we would have desired (if this is being called from a getZoomForExtent() call, then this means that the returned zoom index might not actually contain the entire extent specified... but it’ll be close). Default is false.
1942
+ * @returns A suitable zoom level for the specified resolution. If no baselayer is set, returns null.
1943
+ */
1944
+ getZoomForResolution(resolution: number, closest: boolean): number;
1945
+ /**
1946
+ * Zoom to a specific zoom level. Zooming will be animated unless the map is configured with {zoomMethod: null}. To zoom without animation, use setCenter without a lonlat argument.
1947
+ * @param zoom
1948
+ */
1949
+ zoomTo(zoom: number): void;
1950
+ zoomIn(): void;
1951
+ zoomOut(): void;
1952
+ /**
1953
+ * Zoom to the passed in bounds, recenter
1954
+ * @param bounds If provided as an array, the array should consist of four values (left, bottom, right, top).
1955
+ * @param closest Find the zoom level that most closely fits the specified bounds. Note that this may result in a zoom that does not exactly contain the entire extent. Default is false.
1956
+ */
1957
+ zoomToExtent(bounds: Bounds, closest: boolean): void;
1958
+ /**
1959
+ * Zoom to the full extent and recenter.
1960
+ * @param options
1961
+ */
1962
+ zoomToMaxExtent(options: object): void;
1963
+ /**
1964
+ * Zoom to a specified scale
1965
+ * @param scale
1966
+ * @param closest Find the zoom level that most closely fits the specified scale. Note that this may result in a zoom that does not exactly contain the entire extent. Default is false.
1967
+ */
1968
+ zoomToScale(scale: number, closest: boolean): void;
1969
+ /**
1970
+ *
1971
+ * @param lonlat
1972
+ * @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels by the current base layer.
1973
+ */
1974
+ getViewPortPxFromLonLat(lonlat: LonLat): Pixel;
1975
+ getLonLatFromViewPortPx(viewPortPx: Pixel): LonLat;
1976
+ /**
1977
+ *
1978
+ * @param px An OpenLayers.Pixel or an object with a ‘x’ and ‘y’ properties.
1979
+ * @returns An OpenLayers.LonLat corresponding to the given OpenLayers.Pixel, translated into lon/lat by the current base layer
1980
+ */
1981
+ getLonLatFromPixel(px: Pixel): LonLat;
1982
+ /**
1983
+ * Returns a pixel location given a map location. The map location is translated to an integer pixel location (in viewport pixel coordinates) by the current base layer.
1984
+ * @param lonlat A map location.
1985
+ * @returns An OpenLayers.Pixel corresponding to the OpenLayers.LonLat translated into view port pixels by the current base layer.
1986
+ */
1987
+ getPixelFromLonLat(lonlat: LonLat): Pixel;
1988
+ /**
1989
+ *
1990
+ * @param layerPx
1991
+ * @returns Layer Pixel translated into ViewPort Pixel coordinates
1992
+ */
1993
+ getViewPortPxFromLayerPx(layerPx: Pixel): Pixel;
1994
+ /**
1995
+ *
1996
+ * @param viewPortPx
1997
+ * @returns ViewPort Pixel translated into Layer Pixel coordinates
1998
+ */
1999
+ getLayerPxFromViewPortPx(viewPortPx: Pixel): Pixel;
2000
+ /**
2001
+ *
2002
+ * @param lonlat lonlat
2003
+ * @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into layer pixels by the current base layer
2004
+ */
2005
+ getLayerPxFromLonLat(lonlat: LonLat): Pixel;
2006
+ static readonly TILE_WIDTH: number;
2007
+ static readonly TILE_HEIGHT: number;
2008
+ }
2009
+ export class Marker
2010
+ {
2011
+ lonlat: LonLat;
2012
+ icon: Icon;
2013
+
2014
+ constructor(lonlat: LonLat, icon: Icon);
2015
+ destroy(): void;
2016
+ isDrawn(): boolean;
2017
+ }
2018
+
2019
+ /**
2020
+ * This class represents a screen coordinate, in x and y coordinates
2021
+ */
2022
+ export class Pixel
2023
+ {
2024
+ /** The x coordinate */
2025
+ x: number;
2026
+ /** The y coordinate */
2027
+ y: number;
2028
+ /**
2029
+ * Create a new OpenLayers.Pixel instance
2030
+ * @param x The x coordinate
2031
+ * @param y The y coordinate
2032
+ */
2033
+ constructor(x: number, y: number);
2034
+ /**
2035
+ * Return a clone of this pixel object
2036
+ * @returns A clone pixel
2037
+ */
2038
+ clone(): Pixel;
2039
+ /**
2040
+ * Determine whether one pixel is equivalent to another
2041
+ * @param px An OpenLayers.Pixel or an object with a ‘x’ and ‘y’ properties.
2042
+ * @returns The point passed in as parameter is equal to this. Note that if px passed in is null, returns false.
2043
+ */
2044
+ equals(px: Pixel|null): boolean;
2045
+ /**
2046
+ * Returns the distance to the pixel point passed in as a parameter.
2047
+ * @param px
2048
+ * @returns The pixel point passed in as parameter to calculate the distance to.
2049
+ */
2050
+ distanceTo(px: Pixel): number;
2051
+ /**
2052
+ *
2053
+ * @param x
2054
+ * @param y
2055
+ * @returns A new Pixel with this pixel’s x&y augmented by the values passed in.
2056
+ */
2057
+ add(x: number, y: number): Pixel;
2058
+ /**
2059
+ * Parameters px - {<OpenLayers.Pixel>|Object} An OpenLayers.Pixel or an object with a ‘x’ and ‘y’ properties.
2060
+ * @param px
2061
+ * @returns A new Pixel with this pixel’s x&y augmented by the x&y values of the pixel passed in.
2062
+ */
2063
+ offset(px: Pixel|{x: number, y: number}): Pixel;
2064
+ }
2065
+
2066
+ /**
2067
+ * A popup is a small div that can opened and closed on the map. Typically opened in response to clicking on a marker. See OpenLayers.Marker. Popup’s don’t require their own layer and are added the the map using the OpenLayers.Map.addPopup method.
2068
+ */
2069
+ export class Popup
2070
+ {
2071
+ /** Resize the popup to auto-fit the contents. Default is false. */
2072
+ autoSize: boolean;
2073
+ /** Minimum size allowed for the popup’s contents. */
2074
+ minSize: Size;
2075
+ /** Maximum size allowed for the popup’s contents. */
2076
+ maxSize: Size;
2077
+ /** When drawn, pan map such that the entire popup is visible in the current viewport (if necessary). Default is false. */
2078
+ panMapIfOutOfView: boolean;
2079
+ /**
2080
+ * If panMapIfOutOfView is false, and this property is true, contrain the popup such that it always fits in the available map space. By default, this is not set on the base class. If you are creating popups that are near map edges and not allowing pannning, and especially if you have a popup which has a fixedRelativePosition, setting this to false may be a smart thing to do. Subclasses may want to override this setting.
2081
+ *
2082
+ * Default is false.
2083
+ */
2084
+ keepInMap: boolean;
2085
+ /**
2086
+ * When map pans, close the popup. Default is false.
2087
+ */
2088
+ closeOnMove: boolean;
2089
+ /**
2090
+ * Create a popup.
2091
+ * @param id a unqiue identifier for this popup. If null is passed an identifier will be automatically generated.
2092
+ * @param lonlat The position on the map the popup will be shown.
2093
+ * @param contentSize The size of the content.
2094
+ * @param contentHTML An HTML string to display inside the popup.
2095
+ * @param closeBox Whether to display a close box inside the popup.
2096
+ * @param closeBoxCallback Function to be called on closeBox click.
2097
+ */
2098
+ constructor(id: string, lonlat: LonLat, contentSize: Size|null, contentHTML: string, closeBox: boolean, closeBoxCallback: Function);
2099
+ /**
2100
+ * Auto size the popup so that it precisely fits its contents (as determined by this.contentDiv.innerHTML). Popup size will, of course, be limited by the available space on the current map
2101
+ */
2102
+ updateSize(): void;
2103
+ /**
2104
+ *
2105
+ * @param size Desired size to make the popup.
2106
+ * @returns A size to make the popup which is neither smaller than the specified minimum size, nor bigger than the maximum size (which is calculated relative to the size of the viewport).
2107
+ */
2108
+ getSafeContentSize(size: Size): Size;
2109
+ }
2110
+
2111
+ namespace Popup
2112
+ {
2113
+ export class Anchored extends Popup
2114
+ {
2115
+ /**
2116
+ * If panMapIfOutOfView is false, and this property is true, contrain the popup such that it always fits in the available map space. By default, this is set. If you are creating popups that are near map edges and not allowing pannning, and especially if you have a popup which has a fixedRelativePosition, setting this to false may be a smart thing to do.
2117
+ *
2118
+ * For anchored popups, default is true, since subclasses will usually want this functionality.
2119
+ */
2120
+ keepInMap: boolean;
2121
+ /**
2122
+ *
2123
+ * @param id
2124
+ * @param lonlat
2125
+ * @param contentSize
2126
+ * @param contentHTML
2127
+ * @param anchor Object which must expose a ‘size’ OpenLayers.Size and ‘offset’ OpenLayers.Pixel (generally an OpenLayers.Icon).
2128
+ * @param closeBox
2129
+ * @param closeBoxCallback Function to be called on closeBox click.
2130
+ */
2131
+ constructor(id: string, lonlat: LonLat, contentSize: Size|null, contentHTML: string, anchor: object, closeBox: boolean, closeBoxCallback: Function);
2132
+ destroy(): void;
2133
+ /**
2134
+ * Overridden from Popup since user might hide popup and then show() it in a new location (meaning we might want to update the relative position on the show)
2135
+ */
2136
+ show(): void;
2137
+ /**
2138
+ *
2139
+ * @param contentSize the new size for the popup’s contents div (in pixels).
2140
+ */
2141
+ setSize(contentSize: Size): void;
2142
+ }
2143
+
2144
+ export class Framed extends Anchored
2145
+ {
2146
+ /** The image has some alpha and thus needs to use the alpha image hack. Note that setting this to true will have no noticeable effect in FF or IE7 browsers, but will all but crush the ie6 browser. Default is false. */
2147
+ isAlphaImage: boolean;
2148
+ /** We want the framed popup to work dynamically placed relative to its anchor but also in just one fixed position. A well designed framed popup will have the pixels and logic to display itself in any of the four relative positions, but (understandably), this will not be the case for all of them. By setting this property to ‘true’, framed popup will not recalculate for the best placement each time it’s open, but will always open the same way. Note that if this is set to true, it is generally advisable to also set the ‘panIntoView’ property to true so that the popup can be scrolled into view (since it will often be offscreen on open) Default is false. */
2149
+ fixedRelativePosition: boolean;
2150
+ /**
2151
+ *
2152
+ * @param id
2153
+ * @param lonlat
2154
+ * @param contentSize
2155
+ * @param contentHTML
2156
+ * @param anchor Object which must expose a ‘size’ OpenLayers.Size and ‘offset’ OpenLayers.Pixel (generally an OpenLayers.Icon).
2157
+ * @param closeBox
2158
+ * @param closeBoxCallback Function to be called on closeBox click.
2159
+ */
2160
+ constructor(id: string, lonlat: LonLat, contentSize: Size|null, contentHTML: string, anchor: object, closeBox: boolean, closeBoxCallback: Function);
2161
+ destroy(): void;
2162
+ setBackgroundColor(color: string): void;
2163
+ setBorder(): void;
2164
+ /**
2165
+ * Overridden here, because we need to update the blocks whenever the size of the popup has changed.
2166
+ * @param contentSize the new size for the popup’s contents div (in pixels).
2167
+ */
2168
+ setSize(contentSize: Size): void;
2169
+ }
2170
+
2171
+ export class FramedCloud extends Framed
2172
+ {
2173
+ /** Framed Cloud is autosizing by default. */
2174
+ autoSize: boolean;
2175
+ /** Framed Cloud does pan into view by default. */
2176
+ panMapIfOutOfView: boolean;
2177
+ imageSize: Size;
2178
+ /** The FramedCloud does not use an alpha image (in honor of the good ie6 folk out there) */
2179
+ isAlphaImage: boolean;
2180
+ /** The Framed Cloud popup works in just one fixed position. */
2181
+ fixedRelativePosition: boolean;
2182
+ minSize: Size;
2183
+ maxSize: Size;
2184
+ /**
2185
+ *
2186
+ * @param id
2187
+ * @param lonlat
2188
+ * @param contentSize
2189
+ * @param contentHTML
2190
+ * @param anchor Object which must expose a ‘size’ OpenLayers.Size and ‘offset’ OpenLayers.Pixel (generally an OpenLayers.Icon).
2191
+ * @param closeBox
2192
+ * @param closeBoxCallback Function to be called on closeBox click.
2193
+ */
2194
+ constructor(id: string, lonlat: LonLat, contentSize: Size|null, contentHTML: string, anchor: object|null, closeBox: boolean|null, closeBoxCallback?: Function);
2195
+ }
2196
+ }
2197
+
2198
+ /**
2199
+ * Methods for coordinate transforms between coordinate systems. By default, OpenLayers ships with the ability to transform coordinates between geographic (EPSG:4326) and web or spherical mercator (EPSG:900913 et al.) coordinate reference systems. See the transform method for details on usage.
2200
+ *
2201
+ * Additional transforms may be added by using the proj4js library. If the proj4js library is included, the transform method will work between any two coordinate reference systems with proj4js definitions.
2202
+ *
2203
+ * If the proj4js library is not included, or if you wish to allow transforms between arbitrary coordinate reference systems, use the addTransform method to register a custom transform method.
2204
+ */
2205
+ export class Projection
2206
+ {
2207
+ /**
2208
+ * This class offers several methods for interacting with a wrapped pro4js projection object.
2209
+ * @param projCode A string identifying the Well Known Identifier for the projection.
2210
+ * @param options An optional object to set additional properties on the projection.
2211
+ * @returns A projection object.
2212
+ */
2213
+ constructor(projCode: string, options?: {});
2214
+ /**
2215
+ * Get the string SRS code.
2216
+ * @returns The SRS code.
2217
+ */
2218
+ getCode(): string;
2219
+ /**
2220
+ * Get the units string for the projection -- returns null if proj4js is not available.
2221
+ * @returns The units abbreviation.
2222
+ *
2223
+ */
2224
+ getUnits(): string;
2225
+ /**
2226
+ * Defaults for the SRS codes known to OpenLayers (currently EPSG:4326, CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, EPSG:900913, EPSG:3857, EPSG:102113, EPSG:102100 and OSGEO:41001). Keys are the SRS code, values are units, maxExtent (the validity extent for the SRS in projected coordinates), worldExtent (the world’s extent in EPSG:4326) and yx (true if this SRS is known to have a reverse axis order).
2227
+ */
2228
+ static defaults: Projection;
2229
+ /**
2230
+ * Set a custom transform method between two projections. Use this method in cases where the proj4js lib is not available or where custom projections need to be handled.
2231
+ * @param from The code for the source projection
2232
+ * @param to the code for the destination projection
2233
+ * @param method A function that takes a point as an argument and transforms that point from the source to the destination projection in place. The original point should be modified.
2234
+ */
2235
+ static addTransform(from: string, to: string, method: (point: Point) => void): void;
2236
+ /**
2237
+ * Transform a point coordinate from one projection to another. Note that the input point is transformed in place.
2238
+ * @param point An object with x and y properties representing coordinates in those dimensions.
2239
+ * @param source Source map coordinate system
2240
+ * @param dest Destination map coordinate system
2241
+ * @returns A transformed coordinate. The original point is modified.
2242
+ */
2243
+ static transform(point: Point|{x: number, y: number}, source: Projection, dest: Projection): Point;
2244
+ /**
2245
+ * A null transformation useful for defining projection aliases when proj4js is not available:
2246
+ * @param point
2247
+ */
2248
+ static nullTransform(point: Point): void;
2249
+ }
2250
+
2251
+ /**
2252
+ * Instances of this class represent a width/height pair
2253
+ */
2254
+ export class Size
2255
+ {
2256
+ /** width */
2257
+ w: number;
2258
+ /** height */
2259
+ h: number;
2260
+ /**
2261
+ * Create an instance of OpenLayers.Size
2262
+ * @param w width
2263
+ * @param h height
2264
+ */
2265
+ constructor(w: number, h: number);
2266
+ /**
2267
+ * Create a clone of this size object
2268
+ * @returns A new OpenLayers.Size object with the same w and h values
2269
+ */
2270
+ clone(): Size;
2271
+ /**
2272
+ * Determine where this size is equal to another
2273
+ * @param sz An OpenLayers.Size or an object with a ‘w’ and ‘h’ properties.
2274
+ * @returns The passed in size has the same h and w properties as this one. Note that if sz passed in is null, returns false.
2275
+ */
2276
+ equals(sz: Size|null): boolean;
2277
+ }
2278
+
2279
+ export class Util
2280
+ {
2281
+ /**
2282
+ * Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.
2283
+ * @param p1 (or any object with both .lat, .lon properties)
2284
+ * @param p2 (or any object with both .lat, .lon properties)
2285
+ * @returns The distance (in km) between the two input points as measured on an ellipsoid. Note that the input point objects must be in geographic coordinates (decimal degrees) and the return distance is in kilometers.
2286
+ */
2287
+ static distVincenty(p1: LonLat, p2: LonLat): number;
2288
+ /**
2289
+ * Calculate destination point given start point lat/long (numeric degrees), bearing (numeric degrees) & distance (in m). Adapted from Chris Veness work, see http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html
2290
+ * @param lonlat (or any object with both .lat, .lon properties) The start point.
2291
+ * @param brng The bearing (degrees).
2292
+ * @param dist The ground distance (meters).
2293
+ * @returns The destination point.
2294
+ */
2295
+ static destinationVincenty(lonlat: LonLat, brng: number, dist: number): LonLat;
2296
+ /** Constant inches per unit -- borrowed from MapServer mapscale.c derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) and PROJ.4 (http://trac.osgeo.org/proj/) The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c The hardcoded table of PROJ.4 units are in pj_units.c. */
2297
+ static readonly INCHES_PER_UNIT: object;
2298
+ /** 72 (A sensible default) */
2299
+ static readonly DOTS_PER_INCH: number;
2300
+ /** True if the userAgent reports the browser to use the Gecko engine */
2301
+ static readonly IS_GECKO: boolean;
2302
+ /** True if canvas 2d is supported. */
2303
+ static readonly CANVAS_SUPPORTED: boolean;
2304
+ /**
2305
+ * A substring of the navigator.userAgent property. Depending on the userAgent property, this will be the empty string or one of the following:
2306
+ * ”opera” -- Opera
2307
+ * ”msie” -- Internet Explorer
2308
+ * ”safari” -- Safari
2309
+ * ”firefox” -- Firefox
2310
+ * ”mozilla” -- Mozilla
2311
+ */
2312
+ static readonly BROWSER_NAME: string;
2313
+ /**
2314
+ * This function has been modified by the OpenLayers from the original version, written by Matthew Eernisse and released under the Apache 2 license here:
2315
+ *
2316
+ * http://www.fleegix.org/articles/2006/05/30/getting-the-scrollbar-width-in-pixels
2317
+ *
2318
+ * It has been modified simply to cache its value, since it is physically impossible that this code could ever run in more than one browser at once.
2319
+ */
2320
+ static getScrollbarWidth(): number;
2321
+ /**
2322
+ * This function will return latitude or longitude value formatted as
2323
+ * @param coordinate the coordinate value to be formatted
2324
+ * @param axis value of either ‘lat’ or ‘lon’ to indicate which axis is to to be formatted (default = lat)
2325
+ * @param dmsOption specify the precision of the output can be one of: ‘dms’ show degrees minutes and seconds ‘dm’ show only degrees and minutes ‘d’ show only degrees
2326
+ * @returns the coordinate value formatted as a string
2327
+ */
2328
+ static getFormattedLonLat(coordinate: number, axis: string, dmsOption: string): string;
2329
+ }