`
10 | * element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options.
11 | *
12 | * @example
13 | * ```js
14 | * var myIcon = L.divIcon({className: 'my-div-icon'});
15 | * // you can set .my-div-icon styles in CSS
16 | *
17 | * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
18 | * ```
19 | *
20 | * By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.
21 | */
22 |
23 | export var DivIcon = Icon.extend({
24 | options: {
25 | // @section
26 | // @aka DivIcon options
27 | iconSize: [12, 12], // also can be set through CSS
28 |
29 | // iconAnchor: (Point),
30 | // popupAnchor: (Point),
31 |
32 | // @option html: String = ''
33 | // Custom HTML code to put inside the div element, empty by default.
34 | html: false,
35 |
36 | // @option bgPos: Point = [0, 0]
37 | // Optional relative position of the background, in pixels
38 | bgPos: null,
39 |
40 | className: 'leaflet-div-icon'
41 | },
42 |
43 | createIcon: function (oldIcon) {
44 | var div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),
45 | options = this.options;
46 |
47 | div.innerHTML = options.html !== false ? options.html : '';
48 |
49 | if (options.bgPos) {
50 | var bgPos = point(options.bgPos);
51 | div.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';
52 | }
53 | this._setIconStyles(div, 'icon');
54 |
55 | return div;
56 | },
57 |
58 | createShadow: function () {
59 | return null;
60 | }
61 | });
62 |
63 | // @factory L.divIcon(options: DivIcon options)
64 | // Creates a `DivIcon` instance with the given options.
65 | export function divIcon(options) {
66 | return new DivIcon(options);
67 | }
68 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/marker/Icon.Default.js:
--------------------------------------------------------------------------------
1 | import {Icon} from './Icon';
2 | import * as DomUtil from '../../dom/DomUtil';
3 |
4 | /*
5 | * @miniclass Icon.Default (Icon)
6 | * @aka L.Icon.Default
7 | * @section
8 | *
9 | * A trivial subclass of `Icon`, represents the icon to use in `Marker`s when
10 | * no icon is specified. Points to the blue marker image distributed with Leaflet
11 | * releases.
12 | *
13 | * In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options`
14 | * (which is a set of `Icon options`).
15 | *
16 | * If you want to _completely_ replace the default icon, override the
17 | * `L.Marker.prototype.options.icon` with your own icon instead.
18 | */
19 |
20 | export var IconDefault = Icon.extend({
21 |
22 | options: {
23 | iconUrl: 'marker-icon.png',
24 | iconRetinaUrl: 'marker-icon-2x.png',
25 | shadowUrl: 'marker-shadow.png',
26 | iconSize: [25, 41],
27 | iconAnchor: [12, 41],
28 | popupAnchor: [1, -34],
29 | tooltipAnchor: [16, -28],
30 | shadowSize: [41, 41]
31 | },
32 |
33 | _getIconUrl: function (name) {
34 | if (!IconDefault.imagePath) { // Deprecated, backwards-compatibility only
35 | IconDefault.imagePath = this._detectIconPath();
36 | }
37 |
38 | // @option imagePath: String
39 | // `Icon.Default` will try to auto-detect the location of the
40 | // blue icon images. If you are placing these images in a non-standard
41 | // way, set this option to point to the right path.
42 | return (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name);
43 | },
44 |
45 | _detectIconPath: function () {
46 | var el = DomUtil.create('div', 'leaflet-default-icon-path', document.body);
47 | var path = DomUtil.getStyle(el, 'background-image') ||
48 | DomUtil.getStyle(el, 'backgroundImage'); // IE8
49 |
50 | document.body.removeChild(el);
51 |
52 | if (path === null || path.indexOf('url') !== 0) {
53 | path = '';
54 | } else {
55 | path = path.replace(/^url\(["']?/, '').replace(/marker-icon\.png["']?\)$/, '');
56 | }
57 |
58 | return path;
59 | }
60 | });
61 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/marker/Icon.js:
--------------------------------------------------------------------------------
1 | import {Class} from '../../core/Class';
2 | import {setOptions} from '../../core/Util';
3 | import {toPoint as point} from '../../geometry/Point';
4 | import {retina} from '../../core/Browser';
5 |
6 | /*
7 | * @class Icon
8 | * @aka L.Icon
9 | *
10 | * Represents an icon to provide when creating a marker.
11 | *
12 | * @example
13 | *
14 | * ```js
15 | * var myIcon = L.icon({
16 | * iconUrl: 'my-icon.png',
17 | * iconRetinaUrl: 'my-icon@2x.png',
18 | * iconSize: [38, 95],
19 | * iconAnchor: [22, 94],
20 | * popupAnchor: [-3, -76],
21 | * shadowUrl: 'my-icon-shadow.png',
22 | * shadowRetinaUrl: 'my-icon-shadow@2x.png',
23 | * shadowSize: [68, 95],
24 | * shadowAnchor: [22, 94]
25 | * });
26 | *
27 | * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);
28 | * ```
29 | *
30 | * `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default.
31 | *
32 | */
33 |
34 | export var Icon = Class.extend({
35 |
36 | /* @section
37 | * @aka Icon options
38 | *
39 | * @option iconUrl: String = null
40 | * **(required)** The URL to the icon image (absolute or relative to your script path).
41 | *
42 | * @option iconRetinaUrl: String = null
43 | * The URL to a retina sized version of the icon image (absolute or relative to your
44 | * script path). Used for Retina screen devices.
45 | *
46 | * @option iconSize: Point = null
47 | * Size of the icon image in pixels.
48 | *
49 | * @option iconAnchor: Point = null
50 | * The coordinates of the "tip" of the icon (relative to its top left corner). The icon
51 | * will be aligned so that this point is at the marker's geographical location. Centered
52 | * by default if size is specified, also can be set in CSS with negative margins.
53 | *
54 | * @option popupAnchor: Point = [0, 0]
55 | * The coordinates of the point from which popups will "open", relative to the icon anchor.
56 | *
57 | * @option tooltipAnchor: Point = [0, 0]
58 | * The coordinates of the point from which tooltips will "open", relative to the icon anchor.
59 | *
60 | * @option shadowUrl: String = null
61 | * The URL to the icon shadow image. If not specified, no shadow image will be created.
62 | *
63 | * @option shadowRetinaUrl: String = null
64 | *
65 | * @option shadowSize: Point = null
66 | * Size of the shadow image in pixels.
67 | *
68 | * @option shadowAnchor: Point = null
69 | * The coordinates of the "tip" of the shadow (relative to its top left corner) (the same
70 | * as iconAnchor if not specified).
71 | *
72 | * @option className: String = ''
73 | * A custom class name to assign to both icon and shadow images. Empty by default.
74 | */
75 |
76 | options: {
77 | popupAnchor: [0, 0],
78 | tooltipAnchor: [0, 0]
79 | },
80 |
81 | initialize: function (options) {
82 | setOptions(this, options);
83 | },
84 |
85 | // @method createIcon(oldIcon?: HTMLElement): HTMLElement
86 | // Called internally when the icon has to be shown, returns a `
![]()
` HTML element
87 | // styled according to the options.
88 | createIcon: function (oldIcon) {
89 | return this._createIcon('icon', oldIcon);
90 | },
91 |
92 | // @method createShadow(oldIcon?: HTMLElement): HTMLElement
93 | // As `createIcon`, but for the shadow beneath it.
94 | createShadow: function (oldIcon) {
95 | return this._createIcon('shadow', oldIcon);
96 | },
97 |
98 | _createIcon: function (name, oldIcon) {
99 | var src = this._getIconUrl(name);
100 |
101 | if (!src) {
102 | if (name === 'icon') {
103 | throw new Error('iconUrl not set in Icon options (see the docs).');
104 | }
105 | return null;
106 | }
107 |
108 | var img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null);
109 | this._setIconStyles(img, name);
110 |
111 | return img;
112 | },
113 |
114 | _setIconStyles: function (img, name) {
115 | var options = this.options;
116 | var sizeOption = options[name + 'Size'];
117 |
118 | if (typeof sizeOption === 'number') {
119 | sizeOption = [sizeOption, sizeOption];
120 | }
121 |
122 | var size = point(sizeOption),
123 | anchor = point(name === 'shadow' && options.shadowAnchor || options.iconAnchor ||
124 | size && size.divideBy(2, true));
125 |
126 | img.className = 'leaflet-marker-' + name + ' ' + (options.className || '');
127 |
128 | if (anchor) {
129 | img.style.marginLeft = (-anchor.x) + 'px';
130 | img.style.marginTop = (-anchor.y) + 'px';
131 | }
132 |
133 | if (size) {
134 | img.style.width = size.x + 'px';
135 | img.style.height = size.y + 'px';
136 | }
137 | },
138 |
139 | _createImg: function (src, el) {
140 | el = el || document.createElement('img');
141 | el.src = src;
142 | return el;
143 | },
144 |
145 | _getIconUrl: function (name) {
146 | return retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];
147 | }
148 | });
149 |
150 |
151 | // @factory L.icon(options: Icon options)
152 | // Creates an icon instance with the given options.
153 | export function icon(options) {
154 | return new Icon(options);
155 | }
156 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/marker/Marker.Drag.js:
--------------------------------------------------------------------------------
1 | import {Handler} from '../../core/Handler';
2 | import * as DomUtil from '../../dom/DomUtil';
3 | import {Draggable} from '../../dom/Draggable';
4 | import {toBounds} from '../../geometry/Bounds';
5 | import {toPoint} from '../../geometry/Point';
6 | import {requestAnimFrame, cancelAnimFrame} from '../../core/Util';
7 |
8 | /*
9 | * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.
10 | */
11 |
12 |
13 | /* @namespace Marker
14 | * @section Interaction handlers
15 | *
16 | * Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see `Handler` methods). Example:
17 | *
18 | * ```js
19 | * marker.dragging.disable();
20 | * ```
21 | *
22 | * @property dragging: Handler
23 | * Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)).
24 | */
25 |
26 | export var MarkerDrag = Handler.extend({
27 | initialize: function (marker) {
28 | this._marker = marker;
29 | },
30 |
31 | addHooks: function () {
32 | var icon = this._marker._icon;
33 |
34 | if (!this._draggable) {
35 | this._draggable = new Draggable(icon, icon, true);
36 | }
37 |
38 | this._draggable.on({
39 | dragstart: this._onDragStart,
40 | predrag: this._onPreDrag,
41 | drag: this._onDrag,
42 | dragend: this._onDragEnd
43 | }, this).enable();
44 |
45 | DomUtil.addClass(icon, 'leaflet-marker-draggable');
46 | },
47 |
48 | removeHooks: function () {
49 | this._draggable.off({
50 | dragstart: this._onDragStart,
51 | predrag: this._onPreDrag,
52 | drag: this._onDrag,
53 | dragend: this._onDragEnd
54 | }, this).disable();
55 |
56 | if (this._marker._icon) {
57 | DomUtil.removeClass(this._marker._icon, 'leaflet-marker-draggable');
58 | }
59 | },
60 |
61 | moved: function () {
62 | return this._draggable && this._draggable._moved;
63 | },
64 |
65 | _adjustPan: function (e) {
66 | var marker = this._marker,
67 | map = marker._map,
68 | speed = this._marker.options.autoPanSpeed,
69 | padding = this._marker.options.autoPanPadding,
70 | iconPos = DomUtil.getPosition(marker._icon),
71 | bounds = map.getPixelBounds(),
72 | origin = map.getPixelOrigin();
73 |
74 | var panBounds = toBounds(
75 | bounds.min._subtract(origin).add(padding),
76 | bounds.max._subtract(origin).subtract(padding)
77 | );
78 |
79 | if (!panBounds.contains(iconPos)) {
80 | // Compute incremental movement
81 | var movement = toPoint(
82 | (Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -
83 | (Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),
84 |
85 | (Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -
86 | (Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)
87 | ).multiplyBy(speed);
88 |
89 | map.panBy(movement, {animate: false});
90 |
91 | this._draggable._newPos._add(movement);
92 | this._draggable._startPos._add(movement);
93 |
94 | DomUtil.setPosition(marker._icon, this._draggable._newPos);
95 | this._onDrag(e);
96 |
97 | this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));
98 | }
99 | },
100 |
101 | _onDragStart: function () {
102 | // @section Dragging events
103 | // @event dragstart: Event
104 | // Fired when the user starts dragging the marker.
105 |
106 | // @event movestart: Event
107 | // Fired when the marker starts moving (because of dragging).
108 |
109 | this._oldLatLng = this._marker.getLatLng();
110 | this._marker
111 | .closePopup()
112 | .fire('movestart')
113 | .fire('dragstart');
114 | },
115 |
116 | _onPreDrag: function (e) {
117 | if (this._marker.options.autoPan) {
118 | cancelAnimFrame(this._panRequest);
119 | this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));
120 | }
121 | },
122 |
123 | _onDrag: function (e) {
124 | var marker = this._marker,
125 | shadow = marker._shadow,
126 | iconPos = DomUtil.getPosition(marker._icon),
127 | latlng = marker._map.layerPointToLatLng(iconPos);
128 |
129 | // update shadow position
130 | if (shadow) {
131 | DomUtil.setPosition(shadow, iconPos);
132 | }
133 |
134 | marker._latlng = latlng;
135 | e.latlng = latlng;
136 | e.oldLatLng = this._oldLatLng;
137 |
138 | // @event drag: Event
139 | // Fired repeatedly while the user drags the marker.
140 | marker
141 | .fire('move', e)
142 | .fire('drag', e);
143 | },
144 |
145 | _onDragEnd: function (e) {
146 | // @event dragend: DragEndEvent
147 | // Fired when the user stops dragging the marker.
148 |
149 | cancelAnimFrame(this._panRequest);
150 |
151 | // @event moveend: Event
152 | // Fired when the marker stops moving (because of dragging).
153 | delete this._oldLatLng;
154 | this._marker
155 | .fire('moveend')
156 | .fire('dragend', e);
157 | }
158 | });
159 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/marker/index.js:
--------------------------------------------------------------------------------
1 | import {Icon} from './Icon';
2 | export {icon} from './Icon';
3 | import {IconDefault} from './Icon.Default';
4 | Icon.Default = IconDefault;
5 | export {Icon};
6 |
7 | export {DivIcon, divIcon} from './DivIcon';
8 | export {Marker, marker} from './Marker';
9 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/tile/TileLayer.WMS.js:
--------------------------------------------------------------------------------
1 | import {TileLayer} from './TileLayer';
2 | import {extend, setOptions, getParamString} from '../../core/Util';
3 | import {retina} from '../../core/Browser';
4 | import {EPSG4326} from '../../geo/crs/CRS.EPSG4326';
5 | import {toBounds} from '../../geometry/Bounds';
6 |
7 | /*
8 | * @class TileLayer.WMS
9 | * @inherits TileLayer
10 | * @aka L.TileLayer.WMS
11 | * Used to display [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services as tile layers on the map. Extends `TileLayer`.
12 | *
13 | * @example
14 | *
15 | * ```js
16 | * var nexrad = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
17 | * layers: 'nexrad-n0r-900913',
18 | * format: 'image/png',
19 | * transparent: true,
20 | * attribution: "Weather data © 2012 IEM Nexrad"
21 | * });
22 | * ```
23 | */
24 |
25 | export var TileLayerWMS = TileLayer.extend({
26 |
27 | // @section
28 | // @aka TileLayer.WMS options
29 | // If any custom options not documented here are used, they will be sent to the
30 | // WMS server as extra parameters in each request URL. This can be useful for
31 | // [non-standard vendor WMS parameters](http://docs.geoserver.org/stable/en/user/services/wms/vendor.html).
32 | defaultWmsParams: {
33 | service: 'WMS',
34 | request: 'GetMap',
35 |
36 | // @option layers: String = ''
37 | // **(required)** Comma-separated list of WMS layers to show.
38 | layers: '',
39 |
40 | // @option styles: String = ''
41 | // Comma-separated list of WMS styles.
42 | styles: '',
43 |
44 | // @option format: String = 'image/jpeg'
45 | // WMS image format (use `'image/png'` for layers with transparency).
46 | format: 'image/jpeg',
47 |
48 | // @option transparent: Boolean = false
49 | // If `true`, the WMS service will return images with transparency.
50 | transparent: false,
51 |
52 | // @option version: String = '1.1.1'
53 | // Version of the WMS service to use
54 | version: '1.1.1'
55 | },
56 |
57 | options: {
58 | // @option crs: CRS = null
59 | // Coordinate Reference System to use for the WMS requests, defaults to
60 | // map CRS. Don't change this if you're not sure what it means.
61 | crs: null,
62 |
63 | // @option uppercase: Boolean = false
64 | // If `true`, WMS request parameter keys will be uppercase.
65 | uppercase: false
66 | },
67 |
68 | initialize: function (url, options) {
69 |
70 | this._url = url;
71 |
72 | var wmsParams = extend({}, this.defaultWmsParams);
73 |
74 | // all keys that are not TileLayer options go to WMS params
75 | for (var i in options) {
76 | if (!(i in this.options)) {
77 | wmsParams[i] = options[i];
78 | }
79 | }
80 |
81 | options = setOptions(this, options);
82 |
83 | var realRetina = options.detectRetina && retina ? 2 : 1;
84 | var tileSize = this.getTileSize();
85 | wmsParams.width = tileSize.x * realRetina;
86 | wmsParams.height = tileSize.y * realRetina;
87 |
88 | this.wmsParams = wmsParams;
89 | },
90 |
91 | onAdd: function (map) {
92 |
93 | this._crs = this.options.crs || map.options.crs;
94 | this._wmsVersion = parseFloat(this.wmsParams.version);
95 |
96 | var projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs';
97 | this.wmsParams[projectionKey] = this._crs.code;
98 |
99 | TileLayer.prototype.onAdd.call(this, map);
100 | },
101 |
102 | getTileUrl: function (coords) {
103 |
104 | var tileBounds = this._tileCoordsToNwSe(coords),
105 | crs = this._crs,
106 | bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])),
107 | min = bounds.min,
108 | max = bounds.max,
109 | bbox = (this._wmsVersion >= 1.3 && this._crs === EPSG4326 ?
110 | [min.y, min.x, max.y, max.x] :
111 | [min.x, min.y, max.x, max.y]).join(','),
112 | url = TileLayer.prototype.getTileUrl.call(this, coords);
113 | return url +
114 | getParamString(this.wmsParams, url, this.options.uppercase) +
115 | (this.options.uppercase ? '&BBOX=' : '&bbox=') + bbox;
116 | },
117 |
118 | // @method setParams(params: Object, noRedraw?: Boolean): this
119 | // Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).
120 | setParams: function (params, noRedraw) {
121 |
122 | extend(this.wmsParams, params);
123 |
124 | if (!noRedraw) {
125 | this.redraw();
126 | }
127 |
128 | return this;
129 | }
130 | });
131 |
132 |
133 | // @factory L.tileLayer.wms(baseUrl: String, options: TileLayer.WMS options)
134 | // Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.
135 | export function tileLayerWMS(url, options) {
136 | return new TileLayerWMS(url, options);
137 | }
138 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/tile/index.js:
--------------------------------------------------------------------------------
1 | export {GridLayer, gridLayer} from './GridLayer';
2 | import {TileLayer, tileLayer} from './TileLayer';
3 | import {TileLayerWMS, tileLayerWMS} from './TileLayer.WMS';
4 | TileLayer.WMS = TileLayerWMS;
5 | tileLayer.wms = tileLayerWMS;
6 | export {TileLayer, tileLayer};
7 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/Circle.js:
--------------------------------------------------------------------------------
1 | import {CircleMarker} from './CircleMarker';
2 | import {Path} from './Path';
3 | import * as Util from '../../core/Util';
4 | import {toLatLng} from '../../geo/LatLng';
5 | import {LatLngBounds} from '../../geo/LatLngBounds';
6 | import {Earth} from '../../geo/crs/CRS.Earth';
7 |
8 |
9 | /*
10 | * @class Circle
11 | * @aka L.Circle
12 | * @inherits CircleMarker
13 | *
14 | * A class for drawing circle overlays on a map. Extends `CircleMarker`.
15 | *
16 | * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).
17 | *
18 | * @example
19 | *
20 | * ```js
21 | * L.circle([50.5, 30.5], {radius: 200}).addTo(map);
22 | * ```
23 | */
24 |
25 | export var Circle = CircleMarker.extend({
26 |
27 | initialize: function (latlng, options, legacyOptions) {
28 | if (typeof options === 'number') {
29 | // Backwards compatibility with 0.7.x factory (latlng, radius, options?)
30 | options = Util.extend({}, legacyOptions, {radius: options});
31 | }
32 | Util.setOptions(this, options);
33 | this._latlng = toLatLng(latlng);
34 |
35 | if (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }
36 |
37 | // @section
38 | // @aka Circle options
39 | // @option radius: Number; Radius of the circle, in meters.
40 | this._mRadius = this.options.radius;
41 | },
42 |
43 | // @method setRadius(radius: Number): this
44 | // Sets the radius of a circle. Units are in meters.
45 | setRadius: function (radius) {
46 | this._mRadius = radius;
47 | return this.redraw();
48 | },
49 |
50 | // @method getRadius(): Number
51 | // Returns the current radius of a circle. Units are in meters.
52 | getRadius: function () {
53 | return this._mRadius;
54 | },
55 |
56 | // @method getBounds(): LatLngBounds
57 | // Returns the `LatLngBounds` of the path.
58 | getBounds: function () {
59 | var half = [this._radius, this._radiusY || this._radius];
60 |
61 | return new LatLngBounds(
62 | this._map.layerPointToLatLng(this._point.subtract(half)),
63 | this._map.layerPointToLatLng(this._point.add(half)));
64 | },
65 |
66 | setStyle: Path.prototype.setStyle,
67 |
68 | _project: function () {
69 |
70 | var lng = this._latlng.lng,
71 | lat = this._latlng.lat,
72 | map = this._map,
73 | crs = map.options.crs;
74 |
75 | if (crs.distance === Earth.distance) {
76 | var d = Math.PI / 180,
77 | latR = (this._mRadius / Earth.R) / d,
78 | top = map.project([lat + latR, lng]),
79 | bottom = map.project([lat - latR, lng]),
80 | p = top.add(bottom).divideBy(2),
81 | lat2 = map.unproject(p).lat,
82 | lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /
83 | (Math.cos(lat * d) * Math.cos(lat2 * d))) / d;
84 |
85 | if (isNaN(lngR) || lngR === 0) {
86 | lngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425
87 | }
88 |
89 | this._point = p.subtract(map.getPixelOrigin());
90 | this._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x;
91 | this._radiusY = p.y - top.y;
92 |
93 | } else {
94 | var latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0]));
95 |
96 | this._point = map.latLngToLayerPoint(this._latlng);
97 | this._radius = this._point.x - map.latLngToLayerPoint(latlng2).x;
98 | }
99 |
100 | this._updateBounds();
101 | }
102 | });
103 |
104 | // @factory L.circle(latlng: LatLng, options?: Circle options)
105 | // Instantiates a circle object given a geographical point, and an options object
106 | // which contains the circle radius.
107 | // @alternative
108 | // @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)
109 | // Obsolete way of instantiating a circle, for compatibility with 0.7.x code.
110 | // Do not use in new applications or plugins.
111 | export function circle(latlng, options, legacyOptions) {
112 | return new Circle(latlng, options, legacyOptions);
113 | }
114 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/CircleMarker.js:
--------------------------------------------------------------------------------
1 | import {Path} from './Path';
2 | import * as Util from '../../core/Util';
3 | import {toLatLng} from '../../geo/LatLng';
4 | import {Bounds} from '../../geometry/Bounds';
5 |
6 |
7 | /*
8 | * @class CircleMarker
9 | * @aka L.CircleMarker
10 | * @inherits Path
11 | *
12 | * A circle of a fixed size with radius specified in pixels. Extends `Path`.
13 | */
14 |
15 | export var CircleMarker = Path.extend({
16 |
17 | // @section
18 | // @aka CircleMarker options
19 | options: {
20 | fill: true,
21 |
22 | // @option radius: Number = 10
23 | // Radius of the circle marker, in pixels
24 | radius: 10
25 | },
26 |
27 | initialize: function (latlng, options) {
28 | Util.setOptions(this, options);
29 | this._latlng = toLatLng(latlng);
30 | this._radius = this.options.radius;
31 | },
32 |
33 | // @method setLatLng(latLng: LatLng): this
34 | // Sets the position of a circle marker to a new location.
35 | setLatLng: function (latlng) {
36 | this._latlng = toLatLng(latlng);
37 | this.redraw();
38 | return this.fire('move', {latlng: this._latlng});
39 | },
40 |
41 | // @method getLatLng(): LatLng
42 | // Returns the current geographical position of the circle marker
43 | getLatLng: function () {
44 | return this._latlng;
45 | },
46 |
47 | // @method setRadius(radius: Number): this
48 | // Sets the radius of a circle marker. Units are in pixels.
49 | setRadius: function (radius) {
50 | this.options.radius = this._radius = radius;
51 | return this.redraw();
52 | },
53 |
54 | // @method getRadius(): Number
55 | // Returns the current radius of the circle
56 | getRadius: function () {
57 | return this._radius;
58 | },
59 |
60 | setStyle : function (options) {
61 | var radius = options && options.radius || this._radius;
62 | Path.prototype.setStyle.call(this, options);
63 | this.setRadius(radius);
64 | return this;
65 | },
66 |
67 | _project: function () {
68 | this._point = this._map.latLngToLayerPoint(this._latlng);
69 | this._updateBounds();
70 | },
71 |
72 | _updateBounds: function () {
73 | var r = this._radius,
74 | r2 = this._radiusY || r,
75 | w = this._clickTolerance(),
76 | p = [r + w, r2 + w];
77 | this._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p));
78 | },
79 |
80 | _update: function () {
81 | if (this._map) {
82 | this._updatePath();
83 | }
84 | },
85 |
86 | _updatePath: function () {
87 | this._renderer._updateCircle(this);
88 | },
89 |
90 | _empty: function () {
91 | return this._radius && !this._renderer._bounds.intersects(this._pxBounds);
92 | },
93 |
94 | // Needed by the `Canvas` renderer for interactivity
95 | _containsPoint: function (p) {
96 | return p.distanceTo(this._point) <= this._radius + this._clickTolerance();
97 | }
98 | });
99 |
100 |
101 | // @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)
102 | // Instantiates a circle marker object given a geographical point, and an optional options object.
103 | export function circleMarker(latlng, options) {
104 | return new CircleMarker(latlng, options);
105 | }
106 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/Path.js:
--------------------------------------------------------------------------------
1 | import {Layer} from '../Layer';
2 | import * as Util from '../../core/Util';
3 |
4 | /*
5 | * @class Path
6 | * @aka L.Path
7 | * @inherits Interactive layer
8 | *
9 | * An abstract class that contains options and constants shared between vector
10 | * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`.
11 | */
12 |
13 | export var Path = Layer.extend({
14 |
15 | // @section
16 | // @aka Path options
17 | options: {
18 | // @option stroke: Boolean = true
19 | // Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.
20 | stroke: true,
21 |
22 | // @option color: String = '#3388ff'
23 | // Stroke color
24 | color: '#3388ff',
25 |
26 | // @option weight: Number = 3
27 | // Stroke width in pixels
28 | weight: 3,
29 |
30 | // @option opacity: Number = 1.0
31 | // Stroke opacity
32 | opacity: 1,
33 |
34 | // @option lineCap: String= 'round'
35 | // A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.
36 | lineCap: 'round',
37 |
38 | // @option lineJoin: String = 'round'
39 | // A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.
40 | lineJoin: 'round',
41 |
42 | // @option dashArray: String = null
43 | // A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
44 | dashArray: null,
45 |
46 | // @option dashOffset: String = null
47 | // A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).
48 | dashOffset: null,
49 |
50 | // @option fill: Boolean = depends
51 | // Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.
52 | fill: false,
53 |
54 | // @option fillColor: String = *
55 | // Fill color. Defaults to the value of the [`color`](#path-color) option
56 | fillColor: null,
57 |
58 | // @option fillOpacity: Number = 0.2
59 | // Fill opacity.
60 | fillOpacity: 0.2,
61 |
62 | // @option fillRule: String = 'evenodd'
63 | // A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.
64 | fillRule: 'evenodd',
65 |
66 | // className: '',
67 |
68 | // Option inherited from "Interactive layer" abstract class
69 | interactive: true,
70 |
71 | // @option bubblingMouseEvents: Boolean = true
72 | // When `true`, a mouse event on this path will trigger the same event on the map
73 | // (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).
74 | bubblingMouseEvents: true
75 | },
76 |
77 | beforeAdd: function (map) {
78 | // Renderer is set here because we need to call renderer.getEvents
79 | // before this.getEvents.
80 | this._renderer = map.getRenderer(this);
81 | },
82 |
83 | onAdd: function () {
84 | this._renderer._initPath(this);
85 | this._reset();
86 | this._renderer._addPath(this);
87 | },
88 |
89 | onRemove: function () {
90 | this._renderer._removePath(this);
91 | },
92 |
93 | // @method redraw(): this
94 | // Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
95 | redraw: function () {
96 | if (this._map) {
97 | this._renderer._updatePath(this);
98 | }
99 | return this;
100 | },
101 |
102 | // @method setStyle(style: Path options): this
103 | // Changes the appearance of a Path based on the options in the `Path options` object.
104 | setStyle: function (style) {
105 | Util.setOptions(this, style);
106 | if (this._renderer) {
107 | this._renderer._updateStyle(this);
108 | }
109 | return this;
110 | },
111 |
112 | // @method bringToFront(): this
113 | // Brings the layer to the top of all path layers.
114 | bringToFront: function () {
115 | if (this._renderer) {
116 | this._renderer._bringToFront(this);
117 | }
118 | return this;
119 | },
120 |
121 | // @method bringToBack(): this
122 | // Brings the layer to the bottom of all path layers.
123 | bringToBack: function () {
124 | if (this._renderer) {
125 | this._renderer._bringToBack(this);
126 | }
127 | return this;
128 | },
129 |
130 | getElement: function () {
131 | return this._path;
132 | },
133 |
134 | _reset: function () {
135 | // defined in child classes
136 | this._project();
137 | this._update();
138 | },
139 |
140 | _clickTolerance: function () {
141 | // used when doing hit detection for Canvas layers
142 | return (this.options.stroke ? this.options.weight / 2 : 0) + this._renderer.options.tolerance;
143 | }
144 | });
145 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/Rectangle.js:
--------------------------------------------------------------------------------
1 | import {Polygon} from './Polygon';
2 | import {toLatLngBounds} from '../../geo/LatLngBounds';
3 |
4 | /*
5 | * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object.
6 | */
7 |
8 | /*
9 | * @class Rectangle
10 | * @aka L.Rectangle
11 | * @inherits Polygon
12 | *
13 | * A class for drawing rectangle overlays on a map. Extends `Polygon`.
14 | *
15 | * @example
16 | *
17 | * ```js
18 | * // define rectangle geographical bounds
19 | * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];
20 | *
21 | * // create an orange rectangle
22 | * L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(map);
23 | *
24 | * // zoom the map to the rectangle bounds
25 | * map.fitBounds(bounds);
26 | * ```
27 | *
28 | */
29 |
30 |
31 | export var Rectangle = Polygon.extend({
32 | initialize: function (latLngBounds, options) {
33 | Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options);
34 | },
35 |
36 | // @method setBounds(latLngBounds: LatLngBounds): this
37 | // Redraws the rectangle with the passed bounds.
38 | setBounds: function (latLngBounds) {
39 | return this.setLatLngs(this._boundsToLatLngs(latLngBounds));
40 | },
41 |
42 | _boundsToLatLngs: function (latLngBounds) {
43 | latLngBounds = toLatLngBounds(latLngBounds);
44 | return [
45 | latLngBounds.getSouthWest(),
46 | latLngBounds.getNorthWest(),
47 | latLngBounds.getNorthEast(),
48 | latLngBounds.getSouthEast()
49 | ];
50 | }
51 | });
52 |
53 |
54 | // @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options)
55 | export function rectangle(latLngBounds, options) {
56 | return new Rectangle(latLngBounds, options);
57 | }
58 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/Renderer.getRenderer.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../../map/Map';
2 | import {canvas} from './Canvas';
3 | import {svg} from './SVG';
4 |
5 | Map.include({
6 | // @namespace Map; @method getRenderer(layer: Path): Renderer
7 | // Returns the instance of `Renderer` that should be used to render the given
8 | // `Path`. It will ensure that the `renderer` options of the map and paths
9 | // are respected, and that the renderers do exist on the map.
10 | getRenderer: function (layer) {
11 | // @namespace Path; @option renderer: Renderer
12 | // Use this specific instance of `Renderer` for this path. Takes
13 | // precedence over the map's [default renderer](#map-renderer).
14 | var renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer;
15 |
16 | if (!renderer) {
17 | renderer = this._renderer = this._createRenderer();
18 | }
19 |
20 | if (!this.hasLayer(renderer)) {
21 | this.addLayer(renderer);
22 | }
23 | return renderer;
24 | },
25 |
26 | _getPaneRenderer: function (name) {
27 | if (name === 'overlayPane' || name === undefined) {
28 | return false;
29 | }
30 |
31 | var renderer = this._paneRenderers[name];
32 | if (renderer === undefined) {
33 | renderer = this._createRenderer({pane: name});
34 | this._paneRenderers[name] = renderer;
35 | }
36 | return renderer;
37 | },
38 |
39 | _createRenderer: function (options) {
40 | // @namespace Map; @option preferCanvas: Boolean = false
41 | // Whether `Path`s should be rendered on a `Canvas` renderer.
42 | // By default, all `Path`s are rendered in a `SVG` renderer.
43 | return (this.options.preferCanvas && canvas(options)) || svg(options);
44 | }
45 | });
46 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/Renderer.js:
--------------------------------------------------------------------------------
1 | import {Layer} from '../Layer';
2 | import * as DomUtil from '../../dom/DomUtil';
3 | import * as Util from '../../core/Util';
4 | import * as Browser from '../../core/Browser';
5 | import {Bounds} from '../../geometry/Bounds';
6 |
7 |
8 |
9 | /*
10 | * @class Renderer
11 | * @inherits Layer
12 | * @aka L.Renderer
13 | *
14 | * Base class for vector renderer implementations (`SVG`, `Canvas`). Handles the
15 | * DOM container of the renderer, its bounds, and its zoom animation.
16 | *
17 | * A `Renderer` works as an implicit layer group for all `Path`s - the renderer
18 | * itself can be added or removed to the map. All paths use a renderer, which can
19 | * be implicit (the map will decide the type of renderer and use it automatically)
20 | * or explicit (using the [`renderer`](#path-renderer) option of the path).
21 | *
22 | * Do not use this class directly, use `SVG` and `Canvas` instead.
23 | *
24 | * @event update: Event
25 | * Fired when the renderer updates its bounds, center and zoom, for example when
26 | * its map has moved
27 | */
28 |
29 | export var Renderer = Layer.extend({
30 |
31 | // @section
32 | // @aka Renderer options
33 | options: {
34 | // @option padding: Number = 0.1
35 | // How much to extend the clip area around the map view (relative to its size)
36 | // e.g. 0.1 would be 10% of map view in each direction
37 | padding: 0.1,
38 |
39 | // @option tolerance: Number = 0
40 | // How much to extend click tolerance round a path/object on the map
41 | tolerance : 0
42 | },
43 |
44 | initialize: function (options) {
45 | Util.setOptions(this, options);
46 | Util.stamp(this);
47 | this._layers = this._layers || {};
48 | },
49 |
50 | onAdd: function () {
51 | if (!this._container) {
52 | this._initContainer(); // defined by renderer implementations
53 |
54 | if (this._zoomAnimated) {
55 | DomUtil.addClass(this._container, 'leaflet-zoom-animated');
56 | }
57 | }
58 |
59 | this.getPane().appendChild(this._container);
60 | this._update();
61 | this.on('update', this._updatePaths, this);
62 | },
63 |
64 | onRemove: function () {
65 | this.off('update', this._updatePaths, this);
66 | this._destroyContainer();
67 | },
68 |
69 | getEvents: function () {
70 | var events = {
71 | viewreset: this._reset,
72 | zoom: this._onZoom,
73 | moveend: this._update,
74 | zoomend: this._onZoomEnd
75 | };
76 | if (this._zoomAnimated) {
77 | events.zoomanim = this._onAnimZoom;
78 | }
79 | return events;
80 | },
81 |
82 | _onAnimZoom: function (ev) {
83 | this._updateTransform(ev.center, ev.zoom);
84 | },
85 |
86 | _onZoom: function () {
87 | this._updateTransform(this._map.getCenter(), this._map.getZoom());
88 | },
89 |
90 | _updateTransform: function (center, zoom) {
91 | var scale = this._map.getZoomScale(zoom, this._zoom),
92 | position = DomUtil.getPosition(this._container),
93 | viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding),
94 | currentCenterPoint = this._map.project(this._center, zoom),
95 | destCenterPoint = this._map.project(center, zoom),
96 | centerOffset = destCenterPoint.subtract(currentCenterPoint),
97 |
98 | topLeftOffset = viewHalf.multiplyBy(-scale).add(position).add(viewHalf).subtract(centerOffset);
99 |
100 | if (Browser.any3d) {
101 | DomUtil.setTransform(this._container, topLeftOffset, scale);
102 | } else {
103 | DomUtil.setPosition(this._container, topLeftOffset);
104 | }
105 | },
106 |
107 | _reset: function () {
108 | this._update();
109 | this._updateTransform(this._center, this._zoom);
110 |
111 | for (var id in this._layers) {
112 | this._layers[id]._reset();
113 | }
114 | },
115 |
116 | _onZoomEnd: function () {
117 | for (var id in this._layers) {
118 | this._layers[id]._project();
119 | }
120 | },
121 |
122 | _updatePaths: function () {
123 | for (var id in this._layers) {
124 | this._layers[id]._update();
125 | }
126 | },
127 |
128 | _update: function () {
129 | // Update pixel bounds of renderer container (for positioning/sizing/clipping later)
130 | // Subclasses are responsible of firing the 'update' event.
131 | var p = this.options.padding,
132 | size = this._map.getSize(),
133 | min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round();
134 |
135 | this._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());
136 |
137 | this._center = this._map.getCenter();
138 | this._zoom = this._map.getZoom();
139 | }
140 | });
141 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/SVG.Util.js:
--------------------------------------------------------------------------------
1 | import * as Browser from '../../core/Browser';
2 |
3 | // @namespace SVG; @section
4 | // There are several static functions which can be called without instantiating L.SVG:
5 |
6 | // @function create(name: String): SVGElement
7 | // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),
8 | // corresponding to the class name passed. For example, using 'line' will return
9 | // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).
10 | export function svgCreate(name) {
11 | return document.createElementNS('http://www.w3.org/2000/svg', name);
12 | }
13 |
14 | // @function pointsToPath(rings: Point[], closed: Boolean): String
15 | // Generates a SVG path string for multiple rings, with each ring turning
16 | // into "M..L..L.." instructions
17 | export function pointsToPath(rings, closed) {
18 | var str = '',
19 | i, j, len, len2, points, p;
20 |
21 | for (i = 0, len = rings.length; i < len; i++) {
22 | points = rings[i];
23 |
24 | for (j = 0, len2 = points.length; j < len2; j++) {
25 | p = points[j];
26 | str += (j ? 'L' : 'M') + p.x + ' ' + p.y;
27 | }
28 |
29 | // closes the ring for polygons; "x" is VML syntax
30 | str += closed ? (Browser.svg ? 'z' : 'x') : '';
31 | }
32 |
33 | // SVG complains about empty path strings
34 | return str || 'M0 0';
35 | }
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/SVG.VML.js:
--------------------------------------------------------------------------------
1 | import * as DomUtil from '../../dom/DomUtil';
2 | import * as Util from '../../core/Util';
3 | import {Renderer} from './Renderer';
4 |
5 | /*
6 | * Thanks to Dmitry Baranovsky and his Raphael library for inspiration!
7 | */
8 |
9 |
10 | export var vmlCreate = (function () {
11 | try {
12 | document.namespaces.add('lvml', 'urn:schemas-microsoft-com:vml');
13 | return function (name) {
14 | return document.createElement('
');
15 | };
16 | } catch (e) {
17 | return function (name) {
18 | return document.createElement('<' + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">');
19 | };
20 | }
21 | })();
22 |
23 |
24 | /*
25 | * @class SVG
26 | *
27 | * Although SVG is not available on IE7 and IE8, these browsers support [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language), and the SVG renderer will fall back to VML in this case.
28 | *
29 | * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility
30 | * with old versions of Internet Explorer.
31 | */
32 |
33 | // mixin to redefine some SVG methods to handle VML syntax which is similar but with some differences
34 | export var vmlMixin = {
35 |
36 | _initContainer: function () {
37 | this._container = DomUtil.create('div', 'leaflet-vml-container');
38 | },
39 |
40 | _update: function () {
41 | if (this._map._animatingZoom) { return; }
42 | Renderer.prototype._update.call(this);
43 | this.fire('update');
44 | },
45 |
46 | _initPath: function (layer) {
47 | var container = layer._container = vmlCreate('shape');
48 |
49 | DomUtil.addClass(container, 'leaflet-vml-shape ' + (this.options.className || ''));
50 |
51 | container.coordsize = '1 1';
52 |
53 | layer._path = vmlCreate('path');
54 | container.appendChild(layer._path);
55 |
56 | this._updateStyle(layer);
57 | this._layers[Util.stamp(layer)] = layer;
58 | },
59 |
60 | _addPath: function (layer) {
61 | var container = layer._container;
62 | this._container.appendChild(container);
63 |
64 | if (layer.options.interactive) {
65 | layer.addInteractiveTarget(container);
66 | }
67 | },
68 |
69 | _removePath: function (layer) {
70 | var container = layer._container;
71 | DomUtil.remove(container);
72 | layer.removeInteractiveTarget(container);
73 | delete this._layers[Util.stamp(layer)];
74 | },
75 |
76 | _updateStyle: function (layer) {
77 | var stroke = layer._stroke,
78 | fill = layer._fill,
79 | options = layer.options,
80 | container = layer._container;
81 |
82 | container.stroked = !!options.stroke;
83 | container.filled = !!options.fill;
84 |
85 | if (options.stroke) {
86 | if (!stroke) {
87 | stroke = layer._stroke = vmlCreate('stroke');
88 | }
89 | container.appendChild(stroke);
90 | stroke.weight = options.weight + 'px';
91 | stroke.color = options.color;
92 | stroke.opacity = options.opacity;
93 |
94 | if (options.dashArray) {
95 | stroke.dashStyle = Util.isArray(options.dashArray) ?
96 | options.dashArray.join(' ') :
97 | options.dashArray.replace(/( *, *)/g, ' ');
98 | } else {
99 | stroke.dashStyle = '';
100 | }
101 | stroke.endcap = options.lineCap.replace('butt', 'flat');
102 | stroke.joinstyle = options.lineJoin;
103 |
104 | } else if (stroke) {
105 | container.removeChild(stroke);
106 | layer._stroke = null;
107 | }
108 |
109 | if (options.fill) {
110 | if (!fill) {
111 | fill = layer._fill = vmlCreate('fill');
112 | }
113 | container.appendChild(fill);
114 | fill.color = options.fillColor || options.color;
115 | fill.opacity = options.fillOpacity;
116 |
117 | } else if (fill) {
118 | container.removeChild(fill);
119 | layer._fill = null;
120 | }
121 | },
122 |
123 | _updateCircle: function (layer) {
124 | var p = layer._point.round(),
125 | r = Math.round(layer._radius),
126 | r2 = Math.round(layer._radiusY || r);
127 |
128 | this._setPath(layer, layer._empty() ? 'M0 0' :
129 | 'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));
130 | },
131 |
132 | _setPath: function (layer, path) {
133 | layer._path.v = path;
134 | },
135 |
136 | _bringToFront: function (layer) {
137 | DomUtil.toFront(layer._container);
138 | },
139 |
140 | _bringToBack: function (layer) {
141 | DomUtil.toBack(layer._container);
142 | }
143 | };
144 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/layer/vector/index.js:
--------------------------------------------------------------------------------
1 | export {Renderer} from './Renderer';
2 | export {Canvas, canvas} from './Canvas';
3 | import {SVG, create, pointsToPath, svg} from './SVG';
4 | SVG.create = create;
5 | SVG.pointsToPath = pointsToPath;
6 | export {SVG, svg};
7 | import './Renderer.getRenderer'; // This is a bit of a hack, but needed because circular dependencies
8 |
9 | export {Path} from './Path';
10 | export {CircleMarker, circleMarker} from './CircleMarker';
11 | export {Circle, circle} from './Circle';
12 | export {Polyline, polyline} from './Polyline';
13 | export {Polygon, polygon} from './Polygon';
14 | export {Rectangle, rectangle} from './Rectangle';
15 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/Map.methodOptions.leafdoc:
--------------------------------------------------------------------------------
1 |
2 | This file documents the common options passed to several map methods.
3 |
4 |
5 | @miniclass Locate options (Map)
6 | @aka locate options
7 | @section
8 |
9 | Some of the geolocation methods for `Map` take in an `options` parameter. This
10 | is a plain javascript object with the following optional components:
11 |
12 | @option watch: Boolean = false
13 | If `true`, starts continuous watching of location changes (instead of detecting it
14 | once) using W3C `watchPosition` method. You can later stop watching using
15 | `map.stopLocate()` method.
16 |
17 |
18 | @option setView: Boolean = false
19 | If `true`, automatically sets the map view to the user location with respect to
20 | detection accuracy, or to world view if geolocation failed.
21 |
22 | @option maxZoom: Number = Infinity
23 | The maximum zoom for automatic view setting when using `setView` option.
24 |
25 | @option timeout: Number = 10000
26 | Number of milliseconds to wait for a response from geolocation before firing a
27 | `locationerror` event.
28 |
29 | @option maximumAge: Number = 0
30 | Maximum age of detected location. If less than this amount of milliseconds
31 | passed since last geolocation response, `locate` will return a cached location.
32 |
33 | @option enableHighAccuracy: Boolean = false
34 | Enables high accuracy, see [description in the W3C spec](http://dev.w3.org/geo/api/spec-source.html#high-accuracy).
35 |
36 |
37 |
38 | @miniclass Zoom options (Map)
39 | @aka zoom options
40 | @section
41 |
42 | Some of the `Map` methods which modify the zoom level take in an `options`
43 | parameter. This is a plain javascript object with the following optional
44 | components:
45 |
46 |
47 | @option animate: Boolean
48 | If not specified, zoom animation will happen if the zoom origin is inside the
49 | current view. If `true`, the map will attempt animating zoom disregarding where
50 | zoom origin is. Setting `false` will make it always reset the view completely
51 | without animation.
52 |
53 |
54 |
55 |
56 | @miniclass Pan options (Map)
57 | @aka pan options
58 | @section
59 |
60 | Some of the `Map` methods which modify the center of the map take in an `options`
61 | parameter. This is a plain javascript object with the following optional
62 | components:
63 |
64 | @option animate: Boolean
65 | If `true`, panning will always be animated if possible. If `false`, it will
66 | not animate panning, either resetting the map view if panning more than a
67 | screen away, or just setting a new offset for the map pane (except for `panBy`
68 | which always does the latter).
69 |
70 | @option duration: Number = 0.25
71 | Duration of animated panning, in seconds.
72 |
73 | @option easeLinearity: Number = 0.25
74 | The curvature factor of panning animation easing (third parameter of the
75 | [Cubic Bezier curve](http://cubic-bezier.com/)). 1.0 means linear animation,
76 | and the smaller this number, the more bowed the curve.
77 |
78 | @option noMoveStart: Boolean = false
79 | If `true`, panning won't fire `movestart` event on start (used internally for
80 | panning inertia).
81 |
82 |
83 | @miniclass Zoom/pan options (Map)
84 | @aka zoom/pan options
85 | @inherits Zoom options
86 | @inherits Pan options
87 |
88 |
89 | @miniclass FitBounds options (Map)
90 | @aka fitBounds options
91 | @inherits Zoom/pan options
92 |
93 | @option paddingTopLeft: Point = [0, 0]
94 | Sets the amount of padding in the top left corner of a map container that
95 | shouldn't be accounted for when setting the view to fit bounds. Useful if you
96 | have some control overlays on the map like a sidebar and you don't want them
97 | to obscure objects you're zooming to.
98 |
99 | @option paddingBottomRight: Point = [0, 0]
100 | The same for the bottom right corner of the map.
101 |
102 | @option padding: Point = [0, 0]
103 | Equivalent of setting both top left and bottom right padding to the same value.
104 |
105 | @option maxZoom: Number = null
106 | The maximum possible zoom to use.
107 |
108 |
109 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/handler/Map.BoxZoom.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../Map';
2 | import {Handler} from '../../core/Handler';
3 | import * as Util from '../../core/Util';
4 | import * as DomUtil from '../../dom/DomUtil';
5 | import * as DomEvent from '../../dom/DomEvent';
6 | import {LatLngBounds} from '../../geo/LatLngBounds';
7 | import {Bounds} from '../../geometry/Bounds';
8 |
9 | /*
10 | * L.Handler.BoxZoom is used to add shift-drag zoom interaction to the map
11 | * (zoom to a selected bounding box), enabled by default.
12 | */
13 |
14 | // @namespace Map
15 | // @section Interaction Options
16 | Map.mergeOptions({
17 | // @option boxZoom: Boolean = true
18 | // Whether the map can be zoomed to a rectangular area specified by
19 | // dragging the mouse while pressing the shift key.
20 | boxZoom: true
21 | });
22 |
23 | export var BoxZoom = Handler.extend({
24 | initialize: function (map) {
25 | this._map = map;
26 | this._container = map._container;
27 | this._pane = map._panes.overlayPane;
28 | this._resetStateTimeout = 0;
29 | map.on('unload', this._destroy, this);
30 | },
31 |
32 | addHooks: function () {
33 | DomEvent.on(this._container, 'mousedown', this._onMouseDown, this);
34 | },
35 |
36 | removeHooks: function () {
37 | DomEvent.off(this._container, 'mousedown', this._onMouseDown, this);
38 | },
39 |
40 | moved: function () {
41 | return this._moved;
42 | },
43 |
44 | _destroy: function () {
45 | DomUtil.remove(this._pane);
46 | delete this._pane;
47 | },
48 |
49 | _resetState: function () {
50 | this._resetStateTimeout = 0;
51 | this._moved = false;
52 | },
53 |
54 | _clearDeferredResetState: function () {
55 | if (this._resetStateTimeout !== 0) {
56 | clearTimeout(this._resetStateTimeout);
57 | this._resetStateTimeout = 0;
58 | }
59 | },
60 |
61 | _onMouseDown: function (e) {
62 | if (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; }
63 |
64 | // Clear the deferred resetState if it hasn't executed yet, otherwise it
65 | // will interrupt the interaction and orphan a box element in the container.
66 | this._clearDeferredResetState();
67 | this._resetState();
68 |
69 | DomUtil.disableTextSelection();
70 | DomUtil.disableImageDrag();
71 |
72 | this._startPoint = this._map.mouseEventToContainerPoint(e);
73 |
74 | DomEvent.on(document, {
75 | contextmenu: DomEvent.stop,
76 | mousemove: this._onMouseMove,
77 | mouseup: this._onMouseUp,
78 | keydown: this._onKeyDown
79 | }, this);
80 | },
81 |
82 | _onMouseMove: function (e) {
83 | if (!this._moved) {
84 | this._moved = true;
85 |
86 | this._box = DomUtil.create('div', 'leaflet-zoom-box', this._container);
87 | DomUtil.addClass(this._container, 'leaflet-crosshair');
88 |
89 | this._map.fire('boxzoomstart');
90 | }
91 |
92 | this._point = this._map.mouseEventToContainerPoint(e);
93 |
94 | var bounds = new Bounds(this._point, this._startPoint),
95 | size = bounds.getSize();
96 |
97 | DomUtil.setPosition(this._box, bounds.min);
98 |
99 | this._box.style.width = size.x + 'px';
100 | this._box.style.height = size.y + 'px';
101 | },
102 |
103 | _finish: function () {
104 | if (this._moved) {
105 | DomUtil.remove(this._box);
106 | DomUtil.removeClass(this._container, 'leaflet-crosshair');
107 | }
108 |
109 | DomUtil.enableTextSelection();
110 | DomUtil.enableImageDrag();
111 |
112 | DomEvent.off(document, {
113 | contextmenu: DomEvent.stop,
114 | mousemove: this._onMouseMove,
115 | mouseup: this._onMouseUp,
116 | keydown: this._onKeyDown
117 | }, this);
118 | },
119 |
120 | _onMouseUp: function (e) {
121 | if ((e.which !== 1) && (e.button !== 1)) { return; }
122 |
123 | this._finish();
124 |
125 | if (!this._moved) { return; }
126 | // Postpone to next JS tick so internal click event handling
127 | // still see it as "moved".
128 | this._clearDeferredResetState();
129 | this._resetStateTimeout = setTimeout(Util.bind(this._resetState, this), 0);
130 |
131 | var bounds = new LatLngBounds(
132 | this._map.containerPointToLatLng(this._startPoint),
133 | this._map.containerPointToLatLng(this._point));
134 |
135 | this._map
136 | .fitBounds(bounds)
137 | .fire('boxzoomend', {boxZoomBounds: bounds});
138 | },
139 |
140 | _onKeyDown: function (e) {
141 | if (e.keyCode === 27) {
142 | this._finish();
143 | }
144 | }
145 | });
146 |
147 | // @section Handlers
148 | // @property boxZoom: Handler
149 | // Box (shift-drag with mouse) zoom handler.
150 | Map.addInitHook('addHandler', 'boxZoom', BoxZoom);
151 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/handler/Map.DoubleClickZoom.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../Map';
2 | import {Handler} from '../../core/Handler';
3 |
4 | /*
5 | * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default.
6 | */
7 |
8 | // @namespace Map
9 | // @section Interaction Options
10 |
11 | Map.mergeOptions({
12 | // @option doubleClickZoom: Boolean|String = true
13 | // Whether the map can be zoomed in by double clicking on it and
14 | // zoomed out by double clicking while holding shift. If passed
15 | // `'center'`, double-click zoom will zoom to the center of the
16 | // view regardless of where the mouse was.
17 | doubleClickZoom: true
18 | });
19 |
20 | export var DoubleClickZoom = Handler.extend({
21 | addHooks: function () {
22 | this._map.on('dblclick', this._onDoubleClick, this);
23 | },
24 |
25 | removeHooks: function () {
26 | this._map.off('dblclick', this._onDoubleClick, this);
27 | },
28 |
29 | _onDoubleClick: function (e) {
30 | var map = this._map,
31 | oldZoom = map.getZoom(),
32 | delta = map.options.zoomDelta,
33 | zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta;
34 |
35 | if (map.options.doubleClickZoom === 'center') {
36 | map.setZoom(zoom);
37 | } else {
38 | map.setZoomAround(e.containerPoint, zoom);
39 | }
40 | }
41 | });
42 |
43 | // @section Handlers
44 | //
45 | // Map properties include interaction handlers that allow you to control
46 | // interaction behavior in runtime, enabling or disabling certain features such
47 | // as dragging or touch zoom (see `Handler` methods). For example:
48 | //
49 | // ```js
50 | // map.doubleClickZoom.disable();
51 | // ```
52 | //
53 | // @property doubleClickZoom: Handler
54 | // Double click zoom handler.
55 | Map.addInitHook('addHandler', 'doubleClickZoom', DoubleClickZoom);
56 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/handler/Map.Keyboard.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../Map';
2 | import {Handler} from '../../core/Handler';
3 | import {on, off, stop} from '../../dom/DomEvent';
4 | import {toPoint} from '../../geometry/Point';
5 |
6 |
7 | /*
8 | * L.Map.Keyboard is handling keyboard interaction with the map, enabled by default.
9 | */
10 |
11 | // @namespace Map
12 | // @section Keyboard Navigation Options
13 | Map.mergeOptions({
14 | // @option keyboard: Boolean = true
15 | // Makes the map focusable and allows users to navigate the map with keyboard
16 | // arrows and `+`/`-` keys.
17 | keyboard: true,
18 |
19 | // @option keyboardPanDelta: Number = 80
20 | // Amount of pixels to pan when pressing an arrow key.
21 | keyboardPanDelta: 80
22 | });
23 |
24 | export var Keyboard = Handler.extend({
25 |
26 | keyCodes: {
27 | left: [37],
28 | right: [39],
29 | down: [40],
30 | up: [38],
31 | zoomIn: [187, 107, 61, 171],
32 | zoomOut: [189, 109, 54, 173]
33 | },
34 |
35 | initialize: function (map) {
36 | this._map = map;
37 |
38 | this._setPanDelta(map.options.keyboardPanDelta);
39 | this._setZoomDelta(map.options.zoomDelta);
40 | },
41 |
42 | addHooks: function () {
43 | var container = this._map._container;
44 |
45 | // make the container focusable by tabbing
46 | if (container.tabIndex <= 0) {
47 | container.tabIndex = '0';
48 | }
49 |
50 | on(container, {
51 | focus: this._onFocus,
52 | blur: this._onBlur,
53 | mousedown: this._onMouseDown
54 | }, this);
55 |
56 | this._map.on({
57 | focus: this._addHooks,
58 | blur: this._removeHooks
59 | }, this);
60 | },
61 |
62 | removeHooks: function () {
63 | this._removeHooks();
64 |
65 | off(this._map._container, {
66 | focus: this._onFocus,
67 | blur: this._onBlur,
68 | mousedown: this._onMouseDown
69 | }, this);
70 |
71 | this._map.off({
72 | focus: this._addHooks,
73 | blur: this._removeHooks
74 | }, this);
75 | },
76 |
77 | _onMouseDown: function () {
78 | if (this._focused) { return; }
79 |
80 | var body = document.body,
81 | docEl = document.documentElement,
82 | top = body.scrollTop || docEl.scrollTop,
83 | left = body.scrollLeft || docEl.scrollLeft;
84 |
85 | this._map._container.focus();
86 |
87 | window.scrollTo(left, top);
88 | },
89 |
90 | _onFocus: function () {
91 | this._focused = true;
92 | this._map.fire('focus');
93 | },
94 |
95 | _onBlur: function () {
96 | this._focused = false;
97 | this._map.fire('blur');
98 | },
99 |
100 | _setPanDelta: function (panDelta) {
101 | var keys = this._panKeys = {},
102 | codes = this.keyCodes,
103 | i, len;
104 |
105 | for (i = 0, len = codes.left.length; i < len; i++) {
106 | keys[codes.left[i]] = [-1 * panDelta, 0];
107 | }
108 | for (i = 0, len = codes.right.length; i < len; i++) {
109 | keys[codes.right[i]] = [panDelta, 0];
110 | }
111 | for (i = 0, len = codes.down.length; i < len; i++) {
112 | keys[codes.down[i]] = [0, panDelta];
113 | }
114 | for (i = 0, len = codes.up.length; i < len; i++) {
115 | keys[codes.up[i]] = [0, -1 * panDelta];
116 | }
117 | },
118 |
119 | _setZoomDelta: function (zoomDelta) {
120 | var keys = this._zoomKeys = {},
121 | codes = this.keyCodes,
122 | i, len;
123 |
124 | for (i = 0, len = codes.zoomIn.length; i < len; i++) {
125 | keys[codes.zoomIn[i]] = zoomDelta;
126 | }
127 | for (i = 0, len = codes.zoomOut.length; i < len; i++) {
128 | keys[codes.zoomOut[i]] = -zoomDelta;
129 | }
130 | },
131 |
132 | _addHooks: function () {
133 | on(document, 'keydown', this._onKeyDown, this);
134 | },
135 |
136 | _removeHooks: function () {
137 | off(document, 'keydown', this._onKeyDown, this);
138 | },
139 |
140 | _onKeyDown: function (e) {
141 | if (e.altKey || e.ctrlKey || e.metaKey) { return; }
142 |
143 | var key = e.keyCode,
144 | map = this._map,
145 | offset;
146 |
147 | if (key in this._panKeys) {
148 | if (!map._panAnim || !map._panAnim._inProgress) {
149 | offset = this._panKeys[key];
150 | if (e.shiftKey) {
151 | offset = toPoint(offset).multiplyBy(3);
152 | }
153 |
154 | map.panBy(offset);
155 |
156 | if (map.options.maxBounds) {
157 | map.panInsideBounds(map.options.maxBounds);
158 | }
159 | }
160 | } else if (key in this._zoomKeys) {
161 | map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);
162 |
163 | } else if (key === 27 && map._popup && map._popup.options.closeOnEscapeKey) {
164 | map.closePopup();
165 |
166 | } else {
167 | return;
168 | }
169 |
170 | stop(e);
171 | }
172 | });
173 |
174 | // @section Handlers
175 | // @section Handlers
176 | // @property keyboard: Handler
177 | // Keyboard navigation handler.
178 | Map.addInitHook('addHandler', 'keyboard', Keyboard);
179 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/handler/Map.ScrollWheelZoom.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../Map';
2 | import {Handler} from '../../core/Handler';
3 | import * as DomEvent from '../../dom/DomEvent';
4 | import * as Util from '../../core/Util';
5 |
6 | /*
7 | * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map.
8 | */
9 |
10 | // @namespace Map
11 | // @section Interaction Options
12 | Map.mergeOptions({
13 | // @section Mousewheel options
14 | // @option scrollWheelZoom: Boolean|String = true
15 | // Whether the map can be zoomed by using the mouse wheel. If passed `'center'`,
16 | // it will zoom to the center of the view regardless of where the mouse was.
17 | scrollWheelZoom: true,
18 |
19 | // @option wheelDebounceTime: Number = 40
20 | // Limits the rate at which a wheel can fire (in milliseconds). By default
21 | // user can't zoom via wheel more often than once per 40 ms.
22 | wheelDebounceTime: 40,
23 |
24 | // @option wheelPxPerZoomLevel: Number = 60
25 | // How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))
26 | // mean a change of one full zoom level. Smaller values will make wheel-zooming
27 | // faster (and vice versa).
28 | wheelPxPerZoomLevel: 60
29 | });
30 |
31 | export var ScrollWheelZoom = Handler.extend({
32 | addHooks: function () {
33 | DomEvent.on(this._map._container, 'mousewheel', this._onWheelScroll, this);
34 |
35 | this._delta = 0;
36 | },
37 |
38 | removeHooks: function () {
39 | DomEvent.off(this._map._container, 'mousewheel', this._onWheelScroll, this);
40 | },
41 |
42 | _onWheelScroll: function (e) {
43 | var delta = DomEvent.getWheelDelta(e);
44 |
45 | var debounce = this._map.options.wheelDebounceTime;
46 |
47 | this._delta += delta;
48 | this._lastMousePos = this._map.mouseEventToContainerPoint(e);
49 |
50 | if (!this._startTime) {
51 | this._startTime = +new Date();
52 | }
53 |
54 | var left = Math.max(debounce - (+new Date() - this._startTime), 0);
55 |
56 | clearTimeout(this._timer);
57 | this._timer = setTimeout(Util.bind(this._performZoom, this), left);
58 |
59 | DomEvent.stop(e);
60 | },
61 |
62 | _performZoom: function () {
63 | var map = this._map,
64 | zoom = map.getZoom(),
65 | snap = this._map.options.zoomSnap || 0;
66 |
67 | map._stop(); // stop panning and fly animations if any
68 |
69 | // map the delta with a sigmoid function to -4..4 range leaning on -1..1
70 | var d2 = this._delta / (this._map.options.wheelPxPerZoomLevel * 4),
71 | d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2,
72 | d4 = snap ? Math.ceil(d3 / snap) * snap : d3,
73 | delta = map._limitZoom(zoom + (this._delta > 0 ? d4 : -d4)) - zoom;
74 |
75 | this._delta = 0;
76 | this._startTime = null;
77 |
78 | if (!delta) { return; }
79 |
80 | if (map.options.scrollWheelZoom === 'center') {
81 | map.setZoom(zoom + delta);
82 | } else {
83 | map.setZoomAround(this._lastMousePos, zoom + delta);
84 | }
85 | }
86 | });
87 |
88 | // @section Handlers
89 | // @property scrollWheelZoom: Handler
90 | // Scroll wheel zoom handler.
91 | Map.addInitHook('addHandler', 'scrollWheelZoom', ScrollWheelZoom);
92 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/handler/Map.Tap.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../Map';
2 | import {Handler} from '../../core/Handler';
3 | import * as DomEvent from '../../dom/DomEvent';
4 | import {Point} from '../../geometry/Point';
5 | import * as Util from '../../core/Util';
6 | import * as DomUtil from '../../dom/DomUtil';
7 | import * as Browser from '../../core/Browser';
8 |
9 |
10 | /*
11 | * L.Map.Tap is used to enable mobile hacks like quick taps and long hold.
12 | */
13 |
14 | // @namespace Map
15 | // @section Interaction Options
16 | Map.mergeOptions({
17 | // @section Touch interaction options
18 | // @option tap: Boolean = true
19 | // Enables mobile hacks for supporting instant taps (fixing 200ms click
20 | // delay on iOS/Android) and touch holds (fired as `contextmenu` events).
21 | tap: true,
22 |
23 | // @option tapTolerance: Number = 15
24 | // The max number of pixels a user can shift his finger during touch
25 | // for it to be considered a valid tap.
26 | tapTolerance: 15
27 | });
28 |
29 | export var Tap = Handler.extend({
30 | addHooks: function () {
31 | DomEvent.on(this._map._container, 'touchstart', this._onDown, this);
32 | },
33 |
34 | removeHooks: function () {
35 | DomEvent.off(this._map._container, 'touchstart', this._onDown, this);
36 | },
37 |
38 | _onDown: function (e) {
39 | if (!e.touches) { return; }
40 |
41 | DomEvent.preventDefault(e);
42 |
43 | this._fireClick = true;
44 |
45 | // don't simulate click or track longpress if more than 1 touch
46 | if (e.touches.length > 1) {
47 | this._fireClick = false;
48 | clearTimeout(this._holdTimeout);
49 | return;
50 | }
51 |
52 | var first = e.touches[0],
53 | el = first.target;
54 |
55 | this._startPos = this._newPos = new Point(first.clientX, first.clientY);
56 |
57 | // if touching a link, highlight it
58 | if (el.tagName && el.tagName.toLowerCase() === 'a') {
59 | DomUtil.addClass(el, 'leaflet-active');
60 | }
61 |
62 | // simulate long hold but setting a timeout
63 | this._holdTimeout = setTimeout(Util.bind(function () {
64 | if (this._isTapValid()) {
65 | this._fireClick = false;
66 | this._onUp();
67 | this._simulateEvent('contextmenu', first);
68 | }
69 | }, this), 1000);
70 |
71 | this._simulateEvent('mousedown', first);
72 |
73 | DomEvent.on(document, {
74 | touchmove: this._onMove,
75 | touchend: this._onUp
76 | }, this);
77 | },
78 |
79 | _onUp: function (e) {
80 | clearTimeout(this._holdTimeout);
81 |
82 | DomEvent.off(document, {
83 | touchmove: this._onMove,
84 | touchend: this._onUp
85 | }, this);
86 |
87 | if (this._fireClick && e && e.changedTouches) {
88 |
89 | var first = e.changedTouches[0],
90 | el = first.target;
91 |
92 | if (el && el.tagName && el.tagName.toLowerCase() === 'a') {
93 | DomUtil.removeClass(el, 'leaflet-active');
94 | }
95 |
96 | this._simulateEvent('mouseup', first);
97 |
98 | // simulate click if the touch didn't move too much
99 | if (this._isTapValid()) {
100 | this._simulateEvent('click', first);
101 | }
102 | }
103 | },
104 |
105 | _isTapValid: function () {
106 | return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance;
107 | },
108 |
109 | _onMove: function (e) {
110 | var first = e.touches[0];
111 | this._newPos = new Point(first.clientX, first.clientY);
112 | this._simulateEvent('mousemove', first);
113 | },
114 |
115 | _simulateEvent: function (type, e) {
116 | var simulatedEvent = document.createEvent('MouseEvents');
117 |
118 | simulatedEvent._simulated = true;
119 | e.target._simulatedClick = true;
120 |
121 | simulatedEvent.initMouseEvent(
122 | type, true, true, window, 1,
123 | e.screenX, e.screenY,
124 | e.clientX, e.clientY,
125 | false, false, false, false, 0, null);
126 |
127 | e.target.dispatchEvent(simulatedEvent);
128 | }
129 | });
130 |
131 | // @section Handlers
132 | // @property tap: Handler
133 | // Mobile touch hacks (quick tap and touch hold) handler.
134 | if (Browser.touch && !Browser.pointer) {
135 | Map.addInitHook('addHandler', 'tap', Tap);
136 | }
137 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/handler/Map.TouchZoom.js:
--------------------------------------------------------------------------------
1 | import {Map} from '../Map';
2 | import {Handler} from '../../core/Handler';
3 | import * as DomEvent from '../../dom/DomEvent';
4 | import * as Util from '../../core/Util';
5 | import * as DomUtil from '../../dom/DomUtil';
6 | import * as Browser from '../../core/Browser';
7 |
8 | /*
9 | * L.Handler.TouchZoom is used by L.Map to add pinch zoom on supported mobile browsers.
10 | */
11 |
12 | // @namespace Map
13 | // @section Interaction Options
14 | Map.mergeOptions({
15 | // @section Touch interaction options
16 | // @option touchZoom: Boolean|String = *
17 | // Whether the map can be zoomed by touch-dragging with two fingers. If
18 | // passed `'center'`, it will zoom to the center of the view regardless of
19 | // where the touch events (fingers) were. Enabled for touch-capable web
20 | // browsers except for old Androids.
21 | touchZoom: Browser.touch && !Browser.android23,
22 |
23 | // @option bounceAtZoomLimits: Boolean = true
24 | // Set it to false if you don't want the map to zoom beyond min/max zoom
25 | // and then bounce back when pinch-zooming.
26 | bounceAtZoomLimits: true
27 | });
28 |
29 | export var TouchZoom = Handler.extend({
30 | addHooks: function () {
31 | DomUtil.addClass(this._map._container, 'leaflet-touch-zoom');
32 | DomEvent.on(this._map._container, 'touchstart', this._onTouchStart, this);
33 | },
34 |
35 | removeHooks: function () {
36 | DomUtil.removeClass(this._map._container, 'leaflet-touch-zoom');
37 | DomEvent.off(this._map._container, 'touchstart', this._onTouchStart, this);
38 | },
39 |
40 | _onTouchStart: function (e) {
41 | var map = this._map;
42 | if (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming) { return; }
43 |
44 | var p1 = map.mouseEventToContainerPoint(e.touches[0]),
45 | p2 = map.mouseEventToContainerPoint(e.touches[1]);
46 |
47 | this._centerPoint = map.getSize()._divideBy(2);
48 | this._startLatLng = map.containerPointToLatLng(this._centerPoint);
49 | if (map.options.touchZoom !== 'center') {
50 | this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2));
51 | }
52 |
53 | this._startDist = p1.distanceTo(p2);
54 | this._startZoom = map.getZoom();
55 |
56 | this._moved = false;
57 | this._zooming = true;
58 |
59 | map._stop();
60 |
61 | DomEvent.on(document, 'touchmove', this._onTouchMove, this);
62 | DomEvent.on(document, 'touchend', this._onTouchEnd, this);
63 |
64 | DomEvent.preventDefault(e);
65 | },
66 |
67 | _onTouchMove: function (e) {
68 | if (!e.touches || e.touches.length !== 2 || !this._zooming) { return; }
69 |
70 | var map = this._map,
71 | p1 = map.mouseEventToContainerPoint(e.touches[0]),
72 | p2 = map.mouseEventToContainerPoint(e.touches[1]),
73 | scale = p1.distanceTo(p2) / this._startDist;
74 |
75 | this._zoom = map.getScaleZoom(scale, this._startZoom);
76 |
77 | if (!map.options.bounceAtZoomLimits && (
78 | (this._zoom < map.getMinZoom() && scale < 1) ||
79 | (this._zoom > map.getMaxZoom() && scale > 1))) {
80 | this._zoom = map._limitZoom(this._zoom);
81 | }
82 |
83 | if (map.options.touchZoom === 'center') {
84 | this._center = this._startLatLng;
85 | if (scale === 1) { return; }
86 | } else {
87 | // Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng
88 | var delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint);
89 | if (scale === 1 && delta.x === 0 && delta.y === 0) { return; }
90 | this._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);
91 | }
92 |
93 | if (!this._moved) {
94 | map._moveStart(true, false);
95 | this._moved = true;
96 | }
97 |
98 | Util.cancelAnimFrame(this._animRequest);
99 |
100 | var moveFn = Util.bind(map._move, map, this._center, this._zoom, {pinch: true, round: false});
101 | this._animRequest = Util.requestAnimFrame(moveFn, this, true);
102 |
103 | DomEvent.preventDefault(e);
104 | },
105 |
106 | _onTouchEnd: function () {
107 | if (!this._moved || !this._zooming) {
108 | this._zooming = false;
109 | return;
110 | }
111 |
112 | this._zooming = false;
113 | Util.cancelAnimFrame(this._animRequest);
114 |
115 | DomEvent.off(document, 'touchmove', this._onTouchMove);
116 | DomEvent.off(document, 'touchend', this._onTouchEnd);
117 |
118 | // Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.
119 | if (this._map.options.zoomAnimation) {
120 | this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap);
121 | } else {
122 | this._map._resetView(this._center, this._map._limitZoom(this._zoom));
123 | }
124 | }
125 | });
126 |
127 | // @section Handlers
128 | // @property touchZoom: Handler
129 | // Touch zoom handler.
130 | Map.addInitHook('addHandler', 'touchZoom', TouchZoom);
131 |
--------------------------------------------------------------------------------
/imax/static/leaflet/src/map/index.js:
--------------------------------------------------------------------------------
1 | import {Map} from './Map';
2 | import {BoxZoom} from './handler/Map.BoxZoom';
3 | Map.BoxZoom = BoxZoom;
4 | import {DoubleClickZoom} from './handler/Map.DoubleClickZoom';
5 | Map.DoubleClickZoom = DoubleClickZoom;
6 | import {Drag} from './handler/Map.Drag';
7 | Map.Drag = Drag;
8 | import {Keyboard} from './handler/Map.Keyboard';
9 | Map.Keyboard = Keyboard;
10 | import {ScrollWheelZoom} from './handler/Map.ScrollWheelZoom';
11 | Map.ScrollWheelZoom = ScrollWheelZoom;
12 | import {Tap} from './handler/Map.Tap';
13 | Map.Tap = Tap;
14 | import {TouchZoom} from './handler/Map.TouchZoom';
15 | Map.TouchZoom = TouchZoom;
16 |
17 | export {Map, createMap as map} from './Map';
18 |
--------------------------------------------------------------------------------
/imax/static/plugins/L.Control.SlideMenu.css:
--------------------------------------------------------------------------------
1 | .leaflet-control-slidemenu{
2 | cursor: pointer;
3 | }
4 |
5 |
6 | .leaflet-menu{
7 | position: absolute;
8 | background-color: rgba(215, 215, 215, 255);
9 | overflow: auto;
10 | cursor: default;
11 | z-index: 9999;
12 | }
13 |
14 | .leaflet-menu::-webkit-scrollbar{
15 | width: 7px;
16 | height: 7px;
17 | background: #f2f2f2;
18 | }
19 |
20 | .leaflet-menu::-webkit-scrollbar-thumb{
21 | border-radius: 2px;
22 | background: #777;
23 | }
24 |
25 | .leaflet-menu-close-button{
26 | background-color: transparent;
27 | border: none;
28 | font-size: 14pt;
29 | color: #777;
30 | cursor: pointer;
31 | }
32 |
33 | .leaflet-menu-close-button:hover{
34 | color: #4285F4;
35 | }
36 |
--------------------------------------------------------------------------------
/imax/static/plugins/Leaflet.Control.Custom.js:
--------------------------------------------------------------------------------
1 | (function (window, document, undefined) {
2 | L.Control.Custom = L.Control.extend({
3 | version: '1.0.1',
4 | options: {
5 | position: 'topright',
6 | id: '',
7 | title: '',
8 | classes: '',
9 | content: '',
10 | style: {},
11 | datas: {},
12 | events: {},
13 | },
14 | container: null,
15 | onAdd: function (map) {
16 | this.container = L.DomUtil.create('div');
17 | this.container.id = this.options.id;
18 | this.container.title = this.options.title;
19 | this.container.className = this.options.classes;
20 | this.container.innerHTML = this.options.content;
21 |
22 | for (var option in this.options.style)
23 | {
24 | this.container.style[option] = this.options.style[option];
25 | }
26 |
27 | for (var data in this.options.datas)
28 | {
29 | this.container.dataset[data] = this.options.datas[data];
30 | }
31 |
32 |
33 | /* Prevent click events propagation to map */
34 | L.DomEvent.disableClickPropagation(this.container);
35 |
36 | /* Prevent right click event propagation to map */
37 | L.DomEvent.on(this.container, 'contextmenu', function (ev)
38 | {
39 | L.DomEvent.stopPropagation(ev);
40 | });
41 |
42 | /* Prevent scroll events propagation to map when cursor on the div */
43 | L.DomEvent.disableScrollPropagation(this.container);
44 |
45 | for (var event in this.options.events)
46 | {
47 | L.DomEvent.on(this.container, event, this.options.events[event], this.container);
48 | }
49 |
50 | return this.container;
51 | },
52 |
53 | onRemove: function (map) {
54 | for (var event in this.options.events)
55 | {
56 | L.DomEvent.off(this.container, event, this.options.events[event], this.container);
57 | }
58 | },
59 | });
60 |
61 | L.control.custom = function (options) {
62 | return new L.Control.Custom(options);
63 | };
64 |
65 | }(window, document));
--------------------------------------------------------------------------------
/imax/static/plugins/Toolbar.js:
--------------------------------------------------------------------------------
1 | // L.Layer was introduced in Leaflet 1.0 and is not present in earlier releases.
2 | window.L.Toolbar2 = (L.Layer || L.Class).extend({
3 | statics: {
4 | baseClass: 'leaflet-toolbar'
5 | },
6 |
7 | options: {
8 | className: '',
9 | filter: function() { return true; },
10 | actions: []
11 | },
12 |
13 | initialize: function(options) {
14 | L.setOptions(this, options);
15 | this._toolbar_type = this.constructor._toolbar_class_id;
16 | },
17 |
18 | addTo: function(map) {
19 | this._arguments = [].slice.call(arguments);
20 |
21 | map.addLayer(this);
22 |
23 | return this;
24 | },
25 |
26 | onAdd: function(map) {
27 | var currentToolbar = map._toolbars[this._toolbar_type];
28 |
29 | if (this._calculateDepth() === 0) {
30 | if (currentToolbar) { map.removeLayer(currentToolbar); }
31 | map._toolbars[this._toolbar_type] = this;
32 | }
33 | },
34 |
35 | onRemove: function(map) {
36 | /*
37 | * TODO: Cleanup event listeners.
38 | * For some reason, this throws:
39 | * "Uncaught TypeError: Cannot read property 'dragging' of null"
40 | * on this._marker when a toolbar icon is clicked.
41 | */
42 | // for (var i = 0, l = this._disabledEvents.length; i < l; i++) {
43 | // L.DomEvent.off(this._ul, this._disabledEvents[i], L.DomEvent.stopPropagation);
44 | // }
45 |
46 | if (this._calculateDepth() === 0) {
47 | delete map._toolbars[this._toolbar_type];
48 | }
49 | },
50 |
51 | appendToContainer: function(container) {
52 | var baseClass = this.constructor.baseClass + '-' + this._calculateDepth(),
53 | className = baseClass + ' ' + this.options.className,
54 | Action, action,
55 | i, j, l, m;
56 |
57 | this._container = container;
58 | this._ul = L.DomUtil.create('ul', className, container);
59 |
60 | // Ensure that clicks, drags, etc. don't bubble up to the map.
61 | // These are the map events that the L.Draw.Polyline handler listens for.
62 | // Note that L.Draw.Polyline listens to 'mouseup', not 'mousedown', but
63 | // if only 'mouseup' is silenced, then the map gets stuck in a halfway
64 | // state because it receives a 'mousedown' event and is waiting for the
65 | // corresponding 'mouseup' event.
66 | this._disabledEvents = [
67 | 'click', 'mousemove', 'dblclick',
68 | 'mousedown', 'mouseup', 'touchstart'
69 | ];
70 |
71 | for (j = 0, m = this._disabledEvents.length; j < m; j++) {
72 | L.DomEvent.on(this._ul, this._disabledEvents[j], L.DomEvent.stopPropagation);
73 | }
74 |
75 | /* Instantiate each toolbar action and add its corresponding toolbar icon. */
76 | for (i = 0, l = this.options.actions.length; i < l; i++) {
77 | Action = this._getActionConstructor(this.options.actions[i]);
78 |
79 | action = new Action();
80 | action._createIcon(this, this._ul, this._arguments);
81 | }
82 | },
83 |
84 | _getActionConstructor: function(Action) {
85 | var args = this._arguments,
86 | toolbar = this;
87 |
88 | return Action.extend({
89 | initialize: function() {
90 | Action.prototype.initialize.apply(this, args);
91 | },
92 | enable: function(e) {
93 | /* Ensure that only one action in a toolbar will be active at a time. */
94 | if (toolbar._active) { toolbar._active.disable(); }
95 | toolbar._active = this;
96 |
97 | Action.prototype.enable.call(this, e);
98 | }
99 | });
100 | },
101 |
102 | /* Used to hide subToolbars without removing them from the map. */
103 | _hide: function() {
104 | this._ul.style.display = 'none';
105 | },
106 |
107 | /* Used to show subToolbars without removing them from the map. */
108 | _show: function() {
109 | this._ul.style.display = 'block';
110 | },
111 |
112 | _calculateDepth: function() {
113 | var depth = 0,
114 | toolbar = this.parentToolbar;
115 |
116 | while (toolbar) {
117 | depth += 1;
118 | toolbar = toolbar.parentToolbar;
119 | }
120 |
121 | return depth;
122 | }
123 | });
124 |
125 | // L.Mixin.Events is replaced by L.Evented in Leaflet 1.0. L.Layer (also
126 | // introduced in Leaflet 1.0) inherits from L.Evented, so if L.Layer is
127 | // present, then L.Toolbar2 will already support events.
128 | if (!L.Evented) {
129 | L.Toolbar2.include(L.Mixin.Events);
130 | }
131 |
132 | L.toolbar = {};
133 |
134 | var toolbar_class_id = 0;
135 |
136 | L.Toolbar2.extend = function extend(props) {
137 | var statics = L.extend({}, props.statics, {
138 | "_toolbar_class_id": toolbar_class_id
139 | });
140 |
141 | toolbar_class_id += 1;
142 | L.extend(props, { statics: statics });
143 |
144 | return L.Class.extend.call(this, props);
145 | };
146 |
147 | L.Map.addInitHook(function() {
148 | this._toolbars = {};
149 | });
150 |
--------------------------------------------------------------------------------
/imax/static/plugins/easy-button.css:
--------------------------------------------------------------------------------
1 | .leaflet-bar button,
2 | .leaflet-bar button:hover {
3 | background-color: #fff;
4 | border: none;
5 | border-bottom: 1px solid #ccc;
6 | width: 26px;
7 | height: 26px;
8 | line-height: 26px;
9 | display: block;
10 | text-align: center;
11 | text-decoration: none;
12 | color: black;
13 | }
14 |
15 | .leaflet-bar button {
16 | background-position: 50% 50%;
17 | background-repeat: no-repeat;
18 | overflow: hidden;
19 | display: block;
20 | }
21 |
22 | .leaflet-bar button:hover {
23 | background-color: #f4f4f4;
24 | }
25 |
26 | .leaflet-bar button:first-of-type {
27 | border-top-left-radius: 4px;
28 | border-top-right-radius: 4px;
29 | }
30 |
31 | .leaflet-bar button:last-of-type {
32 | border-bottom-left-radius: 4px;
33 | border-bottom-right-radius: 4px;
34 | border-bottom: none;
35 | }
36 |
37 | .leaflet-bar.disabled,
38 | .leaflet-bar button.disabled {
39 | cursor: default;
40 | pointer-events: none;
41 | opacity: .4;
42 | }
43 |
44 | .easy-button-button .button-state{
45 | display: block;
46 | width: 100%;
47 | height: 100%;
48 | position: relative;
49 | }
50 |
51 |
52 | .leaflet-touch .leaflet-bar button {
53 | width: 30px;
54 | height: 30px;
55 | line-height: 30px;
56 | }
57 |
--------------------------------------------------------------------------------
/imax/static/plugins/jquery-sidebar.min.js:
--------------------------------------------------------------------------------
1 | $.fn.sidebar=function(e){var s=this,i=s.find("ul.sidebar-tabs, .sidebar-tabs > ul"),a=s.children(".sidebar-content").first();return e=$.extend({position:"left"},e||{}),s.addClass("sidebar-"+e.position),i.children("li").children('a[href^="#"]').on("click",function(e){e.preventDefault();var i=$(this).closest("li");i.hasClass("active")?s.close():i.hasClass("disabled")||s.open(this.hash.slice(1),i)}),s.find(".sidebar-close").on("click",function(){s.close()}),s.open=function(e,l){void 0===l&&(l=i.find('li > a[href="#'+e+'"]').parent()),a.children(".sidebar-pane.active").removeClass("active"),a.children("#"+e).addClass("active"),i.children("li.active").removeClass("active"),l.addClass("active"),s.trigger("content",{id:e}),s.hasClass("collapsed")&&(s.trigger("opening"),s.removeClass("collapsed"))},s.close=function(){i.children("li.active").removeClass("active"),s.hasClass("collapsed")||(s.trigger("closing"),s.addClass("collapsed"))},s};
--------------------------------------------------------------------------------
/imax/static/plugins/leaflet-search.css:
--------------------------------------------------------------------------------
1 |
2 | .leaflet-container .leaflet-control-search {
3 | position:relative;
4 | float:left;
5 | background:#fff;
6 | color:#1978cf;
7 | border: 2px solid rgba(0,0,0,0.2);
8 | background-clip: padding-box;
9 | -moz-border-radius: 4px;
10 | -webkit-border-radius: 4px;
11 | border-radius: 4px;
12 | background-color: rgba(255, 255, 255, 0.8);
13 | z-index:1000;
14 | margin-left: 10px;
15 | margin-top: 10px;
16 | }
17 | .leaflet-control-search.search-exp {/*expanded*/
18 | background: #fff;
19 | border: 2px solid rgba(0,0,0,0.2);
20 | background-clip: padding-box;
21 | }
22 | .leaflet-control-search .search-input {
23 | display:block;
24 | float:left;
25 | background: #fff;
26 | border:1px solid #666;
27 | border-radius:2px;
28 | height:22px;
29 | padding:0 20px 0 2px;
30 | margin:4px 0 4px 4px;
31 | }
32 | .leaflet-control-search.search-load .search-input {
33 | background: url('loader.gif') no-repeat center right #fff;
34 | }
35 | .leaflet-control-search.search-load .search-cancel {
36 | visibility:hidden;
37 | }
38 | .leaflet-control-search .search-cancel {
39 | display:block;
40 | width:22px;
41 | height:22px;
42 | position:absolute;
43 | right:28px;
44 | margin:6px 0;
45 | background: url('search-icon.png') no-repeat 0 -46px;
46 | text-decoration:none;
47 | filter: alpha(opacity=80);
48 | opacity: 0.8;
49 | }
50 | .leaflet-control-search .search-cancel:hover {
51 | filter: alpha(opacity=100);
52 | opacity: 1;
53 | }
54 | .leaflet-control-search .search-cancel span {
55 | display:none;/* comment for cancel button imageless */
56 | font-size:18px;
57 | line-height:20px;
58 | color:#ccc;
59 | font-weight:bold;
60 | }
61 | .leaflet-control-search .search-cancel:hover span {
62 | color:#aaa;
63 | }
64 | .leaflet-control-search .search-button {
65 | display:block;
66 | float:left;
67 | width:30px;
68 | height:30px;
69 | background: url('search-icon.png') no-repeat 4px 4px #fff;
70 | border-radius:4px;
71 | }
72 | .leaflet-control-search .search-button:hover {
73 | background: url('search-icon.png') no-repeat 4px -20px #fafafa;
74 | }
75 | .leaflet-control-search .search-tooltip {
76 | position:absolute;
77 | top:100%;
78 | left:0;
79 | float:left;
80 | list-style: none;
81 | padding-left: 0;
82 | min-width:120px;
83 | max-height:122px;
84 | box-shadow: 1px 1px 6px rgba(0,0,0,0.4);
85 | background-color: rgba(0, 0, 0, 0.25);
86 | z-index:1010;
87 | overflow-y:auto;
88 | overflow-x:hidden;
89 | cursor: pointer;
90 | }
91 | .leaflet-control-search .search-tip {
92 | margin:2px;
93 | padding:2px 4px;
94 | display:block;
95 | color:black;
96 | background: #eee;
97 | border-radius:.25em;
98 | text-decoration:none;
99 | white-space:nowrap;
100 | vertical-align:center;
101 | }
102 | .leaflet-control-search .search-button:hover {
103 | background-color: #f4f4f4;
104 | }
105 | .leaflet-control-search .search-tip-select,
106 | .leaflet-control-search .search-tip:hover {
107 | background-color: #fff;
108 | }
109 | .leaflet-control-search .search-alert {
110 | cursor:pointer;
111 | clear:both;
112 | font-size:.75em;
113 | margin-bottom:5px;
114 | padding:0 .25em;
115 | color:#e00;
116 | font-weight:bold;
117 | border-radius:.25em;
118 | }
119 |
120 |
121 |
--------------------------------------------------------------------------------
/imax/static/plugins/leaflet-sidebar.min.css:
--------------------------------------------------------------------------------
1 | .sidebar{position:absolute;top:0;bottom:0;width:100%;overflow:hidden;z-index:2000;box-shadow:0 1px 5px rgba(0,0,0,.65)}.sidebar.collapsed{width:40px}@media (min-width:768px) and (max-width:991px){.sidebar{width:305px}.sidebar-pane{min-width:265px}}@media (min-width:992px) and (max-width:1199px){.sidebar{width:390px}}@media (min-width:1200px){.sidebar{width:460px}}.sidebar-left{left:0}.sidebar-right{right:0}@media (min-width:768px){.sidebar{top:10px;bottom:10px;transition:width .5s}.sidebar-left{left:10px}.sidebar-right{right:10px}}.sidebar-tabs{top:0;bottom:0;height:100%;background-color:#fff}.sidebar-left .sidebar-tabs{left:0}.sidebar-right .sidebar-tabs{right:0}.sidebar-tabs,.sidebar-tabs>ul{position:absolute;width:40px;margin:0;padding:0;list-style-type:none}.sidebar-tabs>li,.sidebar-tabs>ul>li{width:100%;height:40px;color:#333;font-size:12pt;overflow:hidden;transition:all 80ms}.sidebar-tabs>li:hover,.sidebar-tabs>ul>li:hover{color:#000;background-color:#eee}.sidebar-tabs>li.active,.sidebar-tabs>ul>li.active{color:#fff;background-color:#0074d9}.sidebar-tabs>li.disabled,.sidebar-tabs>ul>li.disabled{color:rgba(51,51,51,.4)}.sidebar-tabs>li.disabled:hover,.sidebar-tabs>ul>li.disabled:hover{background:0 0}.sidebar-tabs>li.disabled>a,.sidebar-tabs>ul>li.disabled>a{cursor:default}.sidebar-tabs>li>a,.sidebar-tabs>ul>li>a{display:block;width:100%;height:100%;line-height:40px;color:inherit;text-decoration:none;text-align:center}.sidebar-tabs>ul+ul{bottom:0}.sidebar-content{position:absolute;top:0;bottom:0;background-color:rgba(255,255,255,.95);overflow-x:hidden;overflow-y:auto}.sidebar-left .sidebar-content{left:40px;right:0}.sidebar-right .sidebar-content{left:0;right:40px}.sidebar.collapsed>.sidebar-content{overflow-y:hidden}.sidebar-pane{display:none;left:0;right:0;box-sizing:border-box;padding:10px 20px}.sidebar-pane.active{display:block}.sidebar-header{margin:-10px -20px 0;height:40px;padding:0 20px;line-height:40px;font-size:14.4pt;color:#fff;background-color:#0074d9}.sidebar-right .sidebar-header{padding-left:40px}.sidebar-close{position:absolute;top:0;width:40px;height:40px;text-align:center;cursor:pointer}.sidebar-left .sidebar-close{right:0}.sidebar-right .sidebar-close{left:0}.sidebar-left~.sidebar-map{margin-left:40px}.sidebar-right~.sidebar-map{margin-right:40px}.sidebar.leaflet-touch{box-shadow:none;border-right:2px solid rgba(0,0,0,.2)}@media (min-width:768px) and (max-width:991px){.sidebar-left~.sidebar-map .leaflet-left{left:315px}.sidebar-right~.sidebar-map .leaflet-right{right:315px}}@media (min-width:992px) and (max-width:1199px){.sidebar-pane{min-width:350px}.sidebar-left~.sidebar-map .leaflet-left{left:400px}.sidebar-right~.sidebar-map .leaflet-right{right:400px}}@media (min-width:1200px){.sidebar-pane{min-width:420px}.sidebar-left~.sidebar-map .leaflet-left{left:470px}.sidebar-right~.sidebar-map .leaflet-right{right:470px}}@media (min-width:768px){.sidebar-left~.sidebar-map{margin-left:0}.sidebar-right~.sidebar-map{margin-right:0}.sidebar{border-radius:4px}.sidebar.leaflet-touch{border:2px solid rgba(0,0,0,.2)}.sidebar-left~.sidebar-map .leaflet-left{transition:left .5s}.sidebar-left.collapsed~.sidebar-map .leaflet-left{left:50px}.sidebar-right~.sidebar-map .leaflet-right{transition:right .5s}.sidebar-right.collapsed~.sidebar-map .leaflet-right{right:50px}}
--------------------------------------------------------------------------------
/imax/static/plugins/leaflet-sidebar.min.js:
--------------------------------------------------------------------------------
1 | L.Control.Sidebar=L.Control.extend({includes:L.Evented.prototype||L.Mixin.Events,options:{position:"left"},initialize:function(t,s){var i,e;for(L.setOptions(this,s),this._sidebar=L.DomUtil.get(t),L.DomUtil.addClass(this._sidebar,"sidebar-"+this.options.position),L.Browser.touch&&L.DomUtil.addClass(this._sidebar,"leaflet-touch"),i=this._sidebar.children.length-1;i>=0;i--)"DIV"==(e=this._sidebar.children[i]).tagName&&L.DomUtil.hasClass(e,"sidebar-content")&&(this._container=e);for(this._tabitems=this._sidebar.querySelectorAll("ul.sidebar-tabs > li, .sidebar-tabs > ul > li"),i=this._tabitems.length-1;i>=0;i--)this._tabitems[i]._sidebar=this;for(this._panes=[],this._closeButtons=[],i=this._container.children.length-1;i>=0;i--)if("DIV"==(e=this._container.children[i]).tagName&&L.DomUtil.hasClass(e,"sidebar-pane")){this._panes.push(e);for(var o=e.querySelectorAll(".sidebar-close"),a=0,l=o.length;a=0;s--){var e=(i=this._tabitems[s]).querySelector("a");e.hasAttribute("href")&&"#"==e.getAttribute("href").slice(0,1)&&L.DomEvent.on(e,"click",L.DomEvent.preventDefault).on(e,"click",this._onClick,i)}for(s=this._closeButtons.length-1;s>=0;s--)i=this._closeButtons[s],L.DomEvent.on(i,"click",this._onCloseClick,this);return this},removeFrom:function(t){console.log("removeFrom() has been deprecated, please use remove() instead as support for this function will be ending soon."),this.remove(t)},remove:function(t){var s,i;for(this._map=null,s=this._tabitems.length-1;s>=0;s--)i=this._tabitems[s],L.DomEvent.off(i.querySelector("a"),"click",this._onClick);for(s=this._closeButtons.length-1;s>=0;s--)i=this._closeButtons[s],L.DomEvent.off(i,"click",this._onCloseClick,this);return this},open:function(t){var s,i;for(s=this._panes.length-1;s>=0;s--)(i=this._panes[s]).id==t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");for(s=this._tabitems.length-1;s>=0;s--)(i=this._tabitems[s]).querySelector("a").hash=="#"+t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");return this.fire("content",{id:t}),L.DomUtil.hasClass(this._sidebar,"collapsed")&&(this.fire("opening"),L.DomUtil.removeClass(this._sidebar,"collapsed")),this},close:function(){for(var t=this._tabitems.length-1;t>=0;t--){var s=this._tabitems[t];L.DomUtil.hasClass(s,"active")&&L.DomUtil.removeClass(s,"active")}return L.DomUtil.hasClass(this._sidebar,"collapsed")||(this.fire("closing"),L.DomUtil.addClass(this._sidebar,"collapsed")),this},_onClick:function(){L.DomUtil.hasClass(this,"active")?this._sidebar.close():L.DomUtil.hasClass(this,"disabled")||this._sidebar.open(this.querySelector("a").hash.slice(1))},_onCloseClick:function(){this.close()}}),L.control.sidebar=function(t,s){return new L.Control.Sidebar(t,s)};
--------------------------------------------------------------------------------
/imax/static/plugins/leaflet.toolbar.min.css:
--------------------------------------------------------------------------------
1 | .leaflet-toolbar-0{list-style:none;padding-left:0;border:2px solid rgba(0,0,0,.2);border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-toolbar-0>li{position:relative}.leaflet-toolbar-0>li>.leaflet-toolbar-icon{display:block;width:30px;height:30px;line-height:30px;margin-right:0;padding-right:0;border-right:0;text-align:center;text-decoration:none;background-color:#fff}.leaflet-toolbar-0>li>.leaflet-toolbar-icon:hover{background-color:#f4f4f4}.leaflet-toolbar-0 .leaflet-toolbar-1{display:none;list-style:none}.leaflet-toolbar-tip-container{margin:0 auto;margin-top:-16px;height:16px;position:relative;overflow:hidden}.leaflet-toolbar-tip{width:16px;height:16px;margin:-8px auto 0;background-color:#fff;border:2px solid rgba(0,0,0,.2);border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;background-clip:content-box;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-control-toolbar>li>.leaflet-toolbar-icon{border-bottom:1px solid #ccc}.leaflet-control-toolbar>li:first-child>.leaflet-toolbar-icon{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-control-toolbar>li:last-child>.leaflet-toolbar-icon{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom-width:0}.leaflet-control-toolbar .leaflet-toolbar-1{margin:0;padding:0;position:absolute;left:30px;top:0;white-space:nowrap;height:30px}.leaflet-control-toolbar .leaflet-toolbar-1>li{display:inline-block}.leaflet-control-toolbar .leaflet-toolbar-1>li>.leaflet-toolbar-icon{display:block;background-color:#919187;border-left:1px solid #aaa;color:#fff;font:11px/19px "Helvetica Neue",Arial,Helvetica,sans-serif;line-height:30px;text-decoration:none;padding-left:10px;padding-right:10px;height:30px}.leaflet-control-toolbar .leaflet-toolbar-1>li>.leaflet-toolbar-icon:hover{background-color:#a0a098}.leaflet-control-toolbar .leaflet-toolbar-1>li:last-child>.leaflet-toolbar-icon{border-top-right-radius:4px;border-bottom-right-radius:4px}.leaflet-popup-toolbar{position:relative;box-sizing:content-box}.leaflet-popup-toolbar>li{float:left}.leaflet-popup-toolbar>li>.leaflet-toolbar-icon{border-right:1px solid #ccc}.leaflet-popup-toolbar>li:first-child>.leaflet-toolbar-icon{border-top-left-radius:4px;border-bottom-left-radius:4px}.leaflet-popup-toolbar>li:last-child>.leaflet-toolbar-icon{border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-width:0;border-right:none}.leaflet-popup-toolbar .leaflet-toolbar-1{position:absolute;top:30px;left:0;padding-left:0}.leaflet-popup-toolbar .leaflet-toolbar-1>li>.leaflet-toolbar-icon{position:relative;float:left;width:30px;height:30px}
--------------------------------------------------------------------------------
/imax/static/plugins/leaflet.toolbar.min.js:
--------------------------------------------------------------------------------
1 | !function(t,o,i){"use strict";t.L.Toolbar2=(L.Layer||L.Class).extend({statics:{baseClass:"leaflet-toolbar"},options:{className:"",filter:function(){return!0},actions:[]},initialize:function(t){L.setOptions(this,t),this._toolbar_type=this.constructor._toolbar_class_id},addTo:function(t){return this._arguments=[].slice.call(arguments),t.addLayer(this),this},onAdd:function(t){var o=t._toolbars[this._toolbar_type];0===this._calculateDepth()&&(o&&t.removeLayer(o),t._toolbars[this._toolbar_type]=this)},onRemove:function(t){0===this._calculateDepth()&&delete t._toolbars[this._toolbar_type]},appendToContainer:function(t){var o,i,e,n,s=this.constructor.baseClass+"-"+this._calculateDepth()+" "+this.options.className;for(this._container=t,this._ul=L.DomUtil.create("ul",s,t),this._disabledEvents=["click","mousemove","dblclick","mousedown","mouseup","touchstart"],i=0,n=this._disabledEvents.length;i0&&((i=[].slice.call(i)).push(this),e.addTo.apply(e,i),e.appendToContainer(o),this.addHooks=function(t){"function"==typeof n&&n.call(this,t),e._show()},this.removeHooks=function(t){"function"==typeof s&&s.call(this,t),e._hide()})}}),L.toolbarAction=function(t){return new L.Toolbar2.Action(t)},L.Toolbar2.Action.extendOptions=function(t){return this.extend({options:t})},L.Toolbar2.Control=L.Toolbar2.extend({statics:{baseClass:"leaflet-control-toolbar "+L.Toolbar2.baseClass},initialize:function(t){L.Toolbar2.prototype.initialize.call(this,t),this._control=new L.Control.Toolbar(this.options)},onAdd:function(t){this._control.addTo(t),L.Toolbar2.prototype.onAdd.call(this,t),this.appendToContainer(this._control.getContainer())},onRemove:function(t){L.Toolbar2.prototype.onRemove.call(this,t),this._control.remove?this._control.remove():this._control.removeFrom(t)}}),L.Control.Toolbar=L.Control.extend({onAdd:function(){return L.DomUtil.create("div","")}}),L.toolbar.control=function(t){return new L.Toolbar2.Control(t)},L.Toolbar2.Popup=L.Toolbar2.extend({statics:{baseClass:"leaflet-popup-toolbar "+L.Toolbar2.baseClass},options:{anchor:[0,0]},initialize:function(t,o){L.Toolbar2.prototype.initialize.call(this,o),this._marker=new L.Marker(t,{icon:new L.DivIcon({className:this.options.className,iconAnchor:[0,0]})})},onAdd:function(t){this._map=t,this._marker.addTo(t),L.Toolbar2.prototype.onAdd.call(this,t),this.appendToContainer(this._marker._icon),this._setStyles()},onRemove:function(t){t.removeLayer(this._marker),L.Toolbar2.prototype.onRemove.call(this,t),delete this._map},setLatLng:function(t){return this._marker.setLatLng(t),this},_setStyles:function(){for(var t,o,i,e=this._container,n=this._ul,s=L.point(this.options.anchor),a=n.querySelectorAll(".leaflet-toolbar-icon"),l=[],r=0,c=0,h=a.length;c 3:
7 | __version__ = '%s-%s' % (__version__, version_tag[3])
8 |
--------------------------------------------------------------------------------
/jupyter/.ipynb_checkpoints/Untitled-checkpoint.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "from ipyleaflet import *\n"
10 | ]
11 | },
12 | {
13 | "cell_type": "code",
14 | "execution_count": 2,
15 | "metadata": {},
16 | "outputs": [
17 | {
18 | "data": {
19 | "application/vnd.jupyter.widget-view+json": {
20 | "model_id": "e79271271d4e41279dca89145a6ebf23",
21 | "version_major": 2,
22 | "version_minor": 0
23 | },
24 | "text/plain": [
25 | "Map(center=[52, 10], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_tex…"
26 | ]
27 | },
28 | "metadata": {},
29 | "output_type": "display_data"
30 | }
31 | ],
32 | "source": [
33 | "m = Map(center=(52, 10), zoom=8, basemap=basemaps.Hydda.Full, dragging=True)\n",
34 | "m"
35 | ]
36 | },
37 | {
38 | "cell_type": "code",
39 | "execution_count": 3,
40 | "metadata": {},
41 | "outputs": [],
42 | "source": [
43 | "from ipyleaflet import (\n",
44 | " Map, TileLayer, SplitMapControl\n",
45 | ")"
46 | ]
47 | },
48 | {
49 | "cell_type": "code",
50 | "execution_count": 4,
51 | "metadata": {},
52 | "outputs": [],
53 | "source": [
54 | "\n",
55 | "center = [34.6252978589571, -77.34580993652344]\n",
56 | "zoom = 10"
57 | ]
58 | },
59 | {
60 | "cell_type": "code",
61 | "execution_count": 5,
62 | "metadata": {},
63 | "outputs": [
64 | {
65 | "data": {
66 | "application/vnd.jupyter.widget-view+json": {
67 | "model_id": "ce94a412bfe74bcc83c039c5f3bd69b2",
68 | "version_major": 2,
69 | "version_minor": 0
70 | },
71 | "text/plain": [
72 | "Map(center=[34.6252978589571, -77.34580993652344], controls=(ZoomControl(options=['position', 'zoom_in_text', …"
73 | ]
74 | },
75 | "metadata": {},
76 | "output_type": "display_data"
77 | }
78 | ],
79 | "source": [
80 | "m = Map(center=center, zoom=zoom)\n",
81 | "m"
82 | ]
83 | },
84 | {
85 | "cell_type": "code",
86 | "execution_count": 6,
87 | "metadata": {},
88 | "outputs": [],
89 | "source": [
90 | "left = TileLayer(url='https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png')\n",
91 | "right = TileLayer(url='https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png')\n",
92 | "control = SplitMapControl(left_layer=left, right_layer=right)\n",
93 | "m.add_control(control)"
94 | ]
95 | },
96 | {
97 | "cell_type": "code",
98 | "execution_count": null,
99 | "metadata": {},
100 | "outputs": [],
101 | "source": []
102 | }
103 | ],
104 | "metadata": {
105 | "kernelspec": {
106 | "display_name": "Python 3",
107 | "language": "python",
108 | "name": "python3"
109 | },
110 | "language_info": {
111 | "codemirror_mode": {
112 | "name": "ipython",
113 | "version": 3
114 | },
115 | "file_extension": ".py",
116 | "mimetype": "text/x-python",
117 | "name": "python",
118 | "nbconvert_exporter": "python",
119 | "pygments_lexer": "ipython3",
120 | "version": "3.8.3"
121 | }
122 | },
123 | "nbformat": 4,
124 | "nbformat_minor": 4
125 | }
126 |
--------------------------------------------------------------------------------
/jupyter/.ipynb_checkpoints/Untitled1-checkpoint.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 4,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "from ipyleaflet import Map, basemaps, WidgetControl"
10 | ]
11 | },
12 | {
13 | "cell_type": "code",
14 | "execution_count": 5,
15 | "metadata": {},
16 | "outputs": [],
17 | "source": [
18 | "from ipywidgets import IntSlider, ColorPicker, Button, link"
19 | ]
20 | },
21 | {
22 | "cell_type": "code",
23 | "execution_count": 6,
24 | "metadata": {},
25 | "outputs": [
26 | {
27 | "data": {
28 | "application/vnd.jupyter.widget-view+json": {
29 | "model_id": "73464c8db3e9407085fcde34d8627d53",
30 | "version_major": 2,
31 | "version_minor": 0
32 | },
33 | "text/plain": [
34 | "Map(center=[46.01, 6.16], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_ou…"
35 | ]
36 | },
37 | "metadata": {},
38 | "output_type": "display_data"
39 | }
40 | ],
41 | "source": [
42 | "m = Map(center=(46.01, 6.16), zoom=12, basemap=basemaps.Stamen.Terrain)\n",
43 | "m"
44 | ]
45 | },
46 | {
47 | "cell_type": "code",
48 | "execution_count": 8,
49 | "metadata": {},
50 | "outputs": [],
51 | "source": [
52 | "zoom_slider = IntSlider(description='Zoom level:', min=0, max=15, value=7)\n",
53 | "link((zoom_slider, 'value'), (m, 'zoom'))\n",
54 | "widget_control1 = WidgetControl(widget=zoom_slider, position='topright')\n",
55 | "m.add_control(widget_control1)"
56 | ]
57 | },
58 | {
59 | "cell_type": "code",
60 | "execution_count": 10,
61 | "metadata": {},
62 | "outputs": [],
63 | "source": [
64 | "color_picker = ColorPicker(description='Pick a color:')\n",
65 | "widget_control2 = WidgetControl(widget=color_picker, position='bottomright')\n",
66 | "m.add_control(widget_control2)"
67 | ]
68 | },
69 | {
70 | "cell_type": "code",
71 | "execution_count": 11,
72 | "metadata": {},
73 | "outputs": [],
74 | "source": [
75 | "widget_control2.widget = Button(description='Click me!')"
76 | ]
77 | },
78 | {
79 | "cell_type": "code",
80 | "execution_count": 12,
81 | "metadata": {},
82 | "outputs": [],
83 | "source": [
84 | "minimap = Map(\n",
85 | " zoom_control=False, attribution_control=False, \n",
86 | " zoom=5, center=m.center, basemap=basemaps.Stamen.Terrain\n",
87 | ")\n",
88 | "minimap.layout.width = '150px'\n",
89 | "minimap.layout.height = '150px'\n",
90 | "link((minimap, 'center'), (m, 'center'))\n",
91 | "minimap_control = WidgetControl(widget=minimap, position='bottomleft')\n",
92 | "m.add_control(minimap_control)"
93 | ]
94 | },
95 | {
96 | "cell_type": "code",
97 | "execution_count": null,
98 | "metadata": {},
99 | "outputs": [],
100 | "source": []
101 | }
102 | ],
103 | "metadata": {
104 | "kernelspec": {
105 | "display_name": "Python 3",
106 | "language": "python",
107 | "name": "python3"
108 | },
109 | "language_info": {
110 | "codemirror_mode": {
111 | "name": "ipython",
112 | "version": 3
113 | },
114 | "file_extension": ".py",
115 | "mimetype": "text/x-python",
116 | "name": "python",
117 | "nbconvert_exporter": "python",
118 | "pygments_lexer": "ipython3",
119 | "version": "3.8.3"
120 | }
121 | },
122 | "nbformat": 4,
123 | "nbformat_minor": 4
124 | }
125 |
--------------------------------------------------------------------------------
/jupyter/Untitled.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "from ipyleaflet import *\n"
10 | ]
11 | },
12 | {
13 | "cell_type": "code",
14 | "execution_count": 2,
15 | "metadata": {},
16 | "outputs": [
17 | {
18 | "data": {
19 | "application/vnd.jupyter.widget-view+json": {
20 | "model_id": "e79271271d4e41279dca89145a6ebf23",
21 | "version_major": 2,
22 | "version_minor": 0
23 | },
24 | "text/plain": [
25 | "Map(center=[52, 10], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_tex…"
26 | ]
27 | },
28 | "metadata": {},
29 | "output_type": "display_data"
30 | }
31 | ],
32 | "source": [
33 | "m = Map(center=(52, 10), zoom=8, basemap=basemaps.Hydda.Full, dragging=True)\n",
34 | "m"
35 | ]
36 | },
37 | {
38 | "cell_type": "code",
39 | "execution_count": 3,
40 | "metadata": {},
41 | "outputs": [],
42 | "source": [
43 | "from ipyleaflet import (\n",
44 | " Map, TileLayer, SplitMapControl\n",
45 | ")"
46 | ]
47 | },
48 | {
49 | "cell_type": "code",
50 | "execution_count": 4,
51 | "metadata": {},
52 | "outputs": [],
53 | "source": [
54 | "\n",
55 | "center = [34.6252978589571, -77.34580993652344]\n",
56 | "zoom = 10"
57 | ]
58 | },
59 | {
60 | "cell_type": "code",
61 | "execution_count": 5,
62 | "metadata": {},
63 | "outputs": [
64 | {
65 | "data": {
66 | "application/vnd.jupyter.widget-view+json": {
67 | "model_id": "ce94a412bfe74bcc83c039c5f3bd69b2",
68 | "version_major": 2,
69 | "version_minor": 0
70 | },
71 | "text/plain": [
72 | "Map(center=[34.6252978589571, -77.34580993652344], controls=(ZoomControl(options=['position', 'zoom_in_text', …"
73 | ]
74 | },
75 | "metadata": {},
76 | "output_type": "display_data"
77 | }
78 | ],
79 | "source": [
80 | "m = Map(center=center, zoom=zoom)\n",
81 | "m"
82 | ]
83 | },
84 | {
85 | "cell_type": "code",
86 | "execution_count": 6,
87 | "metadata": {},
88 | "outputs": [],
89 | "source": [
90 | "left = TileLayer(url='https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png')\n",
91 | "right = TileLayer(url='https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png')\n",
92 | "control = SplitMapControl(left_layer=left, right_layer=right)\n",
93 | "m.add_control(control)"
94 | ]
95 | },
96 | {
97 | "cell_type": "code",
98 | "execution_count": null,
99 | "metadata": {},
100 | "outputs": [],
101 | "source": []
102 | }
103 | ],
104 | "metadata": {
105 | "kernelspec": {
106 | "display_name": "Python 3",
107 | "language": "python",
108 | "name": "python3"
109 | },
110 | "language_info": {
111 | "codemirror_mode": {
112 | "name": "ipython",
113 | "version": 3
114 | },
115 | "file_extension": ".py",
116 | "mimetype": "text/x-python",
117 | "name": "python",
118 | "nbconvert_exporter": "python",
119 | "pygments_lexer": "ipython3",
120 | "version": "3.8.3"
121 | }
122 | },
123 | "nbformat": 4,
124 | "nbformat_minor": 4
125 | }
126 |
--------------------------------------------------------------------------------
/jupyter/Untitled1.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 4,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "from ipyleaflet import Map, basemaps, WidgetControl"
10 | ]
11 | },
12 | {
13 | "cell_type": "code",
14 | "execution_count": 5,
15 | "metadata": {},
16 | "outputs": [],
17 | "source": [
18 | "from ipywidgets import IntSlider, ColorPicker, Button, link"
19 | ]
20 | },
21 | {
22 | "cell_type": "code",
23 | "execution_count": 6,
24 | "metadata": {},
25 | "outputs": [
26 | {
27 | "data": {
28 | "application/vnd.jupyter.widget-view+json": {
29 | "model_id": "73464c8db3e9407085fcde34d8627d53",
30 | "version_major": 2,
31 | "version_minor": 0
32 | },
33 | "text/plain": [
34 | "Map(center=[46.01, 6.16], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_ou…"
35 | ]
36 | },
37 | "metadata": {},
38 | "output_type": "display_data"
39 | }
40 | ],
41 | "source": [
42 | "m = Map(center=(46.01, 6.16), zoom=12, basemap=basemaps.Stamen.Terrain)\n",
43 | "m"
44 | ]
45 | },
46 | {
47 | "cell_type": "code",
48 | "execution_count": 8,
49 | "metadata": {},
50 | "outputs": [],
51 | "source": [
52 | "zoom_slider = IntSlider(description='Zoom level:', min=0, max=15, value=7)\n",
53 | "link((zoom_slider, 'value'), (m, 'zoom'))\n",
54 | "widget_control1 = WidgetControl(widget=zoom_slider, position='topright')\n",
55 | "m.add_control(widget_control1)"
56 | ]
57 | },
58 | {
59 | "cell_type": "code",
60 | "execution_count": 10,
61 | "metadata": {},
62 | "outputs": [],
63 | "source": [
64 | "color_picker = ColorPicker(description='Pick a color:')\n",
65 | "widget_control2 = WidgetControl(widget=color_picker, position='bottomright')\n",
66 | "m.add_control(widget_control2)"
67 | ]
68 | },
69 | {
70 | "cell_type": "code",
71 | "execution_count": 11,
72 | "metadata": {},
73 | "outputs": [],
74 | "source": [
75 | "widget_control2.widget = Button(description='Click me!')"
76 | ]
77 | },
78 | {
79 | "cell_type": "code",
80 | "execution_count": 12,
81 | "metadata": {},
82 | "outputs": [],
83 | "source": [
84 | "minimap = Map(\n",
85 | " zoom_control=False, attribution_control=False, \n",
86 | " zoom=5, center=m.center, basemap=basemaps.Stamen.Terrain\n",
87 | ")\n",
88 | "minimap.layout.width = '150px'\n",
89 | "minimap.layout.height = '150px'\n",
90 | "link((minimap, 'center'), (m, 'center'))\n",
91 | "minimap_control = WidgetControl(widget=minimap, position='bottomleft')\n",
92 | "m.add_control(minimap_control)"
93 | ]
94 | },
95 | {
96 | "cell_type": "code",
97 | "execution_count": null,
98 | "metadata": {},
99 | "outputs": [],
100 | "source": []
101 | }
102 | ],
103 | "metadata": {
104 | "kernelspec": {
105 | "display_name": "Python 3",
106 | "language": "python",
107 | "name": "python3"
108 | },
109 | "language_info": {
110 | "codemirror_mode": {
111 | "name": "ipython",
112 | "version": 3
113 | },
114 | "file_extension": ".py",
115 | "mimetype": "text/x-python",
116 | "name": "python",
117 | "nbconvert_exporter": "python",
118 | "pygments_lexer": "ipython3",
119 | "version": "3.8.3"
120 | }
121 | },
122 | "nbformat": 4,
123 | "nbformat_minor": 4
124 | }
125 |
--------------------------------------------------------------------------------
/jupyter/crop.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 4,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": [
9 | "import os\n",
10 | "import numpy as np\n",
11 | "from PIL import Image\n",
12 | "import shutil\n"
13 | ]
14 | },
15 | {
16 | "cell_type": "code",
17 | "execution_count": 7,
18 | "metadata": {},
19 | "outputs": [],
20 | "source": [
21 | "def crop(path, input, size):\n",
22 | " try:\n",
23 | " shutil.rmtree(path)\n",
24 | " except:\n",
25 | " pass\n",
26 | " if not os.path.exists(path):\n",
27 | " os.mkdir(path)\n",
28 | " else:\n",
29 | " pass\n",
30 | " im = Image.open(input)\n",
31 | " imgwidth, imgheight = im.size\n",
32 | " print('Original size {} x {}'.format(imgwidth, imgheight))\n",
33 | " k = 0\n",
34 | " for i in range(0,imgheight,size):\n",
35 | " for j in range(0,imgwidth,size):\n",
36 | " box = (j, i, j+size, i+size)\n",
37 | " a = Image.new('RGB', (size, size), \"#dddddd\")\n",
38 | " a.paste(im, (-j, -i))\n",
39 | " #a = im.crop(box)\n",
40 | " if np.shape(a) != (size,size,3):\n",
41 | " print(np.shape(a))\n",
42 | " a.save(os.path.join(path,\"{:05}.png\".format(k)))\n",
43 | " #try:\n",
44 | " ## #o = a.crop(area)\n",
45 | " # a.save(os.path.join(path,\"PNG\",\"%s\" % page,\"IMG-%s.png\" % k))\n",
46 | " #except:\n",
47 | " # print('a')\n",
48 | " # pass\n",
49 | " k +=1\n",
50 | " print('Final X size {}, number of X tiles {}'.format(j+size,(j+size)/size))\n",
51 | " print('Final Y size {}, number of Y tiles {}'.format(i+size,(i+size)/size))\n",
52 | " print('Number of images {}'.format(k))\n",
53 | "\n",
54 | " "
55 | ]
56 | },
57 | {
58 | "cell_type": "code",
59 | "execution_count": 9,
60 | "metadata": {},
61 | "outputs": [
62 | {
63 | "name": "stdout",
64 | "output_type": "stream",
65 | "text": [
66 | "Original size 6000 x 4800\n",
67 | "Final X size 6016, number of X tiles 94.0\n",
68 | "Final Y size 4800, number of Y tiles 75.0\n",
69 | "Number of images 7050\n"
70 | ]
71 | }
72 | ],
73 | "source": [
74 | "crop('pixs/','ps58_16x20.jpg',64)"
75 | ]
76 | },
77 | {
78 | "cell_type": "code",
79 | "execution_count": null,
80 | "metadata": {},
81 | "outputs": [],
82 | "source": []
83 | },
84 | {
85 | "cell_type": "code",
86 | "execution_count": null,
87 | "metadata": {},
88 | "outputs": [],
89 | "source": []
90 | }
91 | ],
92 | "metadata": {
93 | "kernelspec": {
94 | "display_name": "Python 3 (ipykernel)",
95 | "language": "python",
96 | "name": "python3"
97 | },
98 | "language_info": {
99 | "codemirror_mode": {
100 | "name": "ipython",
101 | "version": 3
102 | },
103 | "file_extension": ".py",
104 | "mimetype": "text/x-python",
105 | "name": "python",
106 | "nbconvert_exporter": "python",
107 | "pygments_lexer": "ipython3",
108 | "version": "3.10.4"
109 | }
110 | },
111 | "nbformat": 4,
112 | "nbformat_minor": 4
113 | }
114 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | aiohttp
2 | aiohttp_cors
3 | Pillow
4 | click
5 | pyyaml
6 | coloredlogs
7 | asyncio
8 | numpy
9 | tornado
10 | requests
11 | matplotlib
12 | cairosvg
13 | python-avatars
14 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | import pathlib
2 | import sys
3 | import os
4 | try:
5 | from setuptools import setup, find_packages
6 | except ImportError:
7 | from distutils.core import setup
8 | HERE = pathlib.Path(__file__).parent
9 | README = (HERE / "Readme.md").read_text()
10 |
11 | extra_link_args = []
12 | libraries = []
13 | library_dirs = []
14 | include_dirs = []
15 | exec(open('imax/version.py').read())
16 | setup(
17 | name='imax',
18 | version=__version__,
19 | description='Interactive tool for visualize and classify multiple images at a time',
20 | long_description=README,
21 | long_description_content_type='text/markdown',
22 | author='Matias Carrasco Kind',
23 | author_email='mcarras2@illinois.edu',
24 | scripts=["imax-run"],
25 | packages=['imax'],
26 | package_data = {
27 | 'imax/static': ['*'],
28 | 'imax/templates': ['*'],
29 | 'imax' : ['config_template.yaml']
30 | },
31 | license='LICENSE.txt',
32 | url='https://github.com/mgckind/imax.git',
33 | install_requires=[
34 | "aiohttp",
35 | "aiohttp_cors",
36 | "Pillow",
37 | "click",
38 | "pyyaml",
39 | "coloredlogs",
40 | "asyncio",
41 | "numpy",
42 | "tornado",
43 | "matplotlib",
44 | "requests"
45 | ],
46 | )
47 |
--------------------------------------------------------------------------------