18 |
23 | Bug tested to occur on: Safari on Mac (Tested in 5.1.7), iPad/iPhone 5.1.1., Android 4 Browser. Hack is in L.Browser.chrome and TileLayer._addTile
24 |
25 |
22 |
23 |
34 |
35 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/map/simple-proj.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/map/wms-marble.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
29 |
30 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/map/wms.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/map/zoomlevels.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/tests/bringtoback.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/tests/click_on_canvas.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/tests/click_on_canvas_broken.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/tests/opacity.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/tests/removetilewhilepan.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/vector/editable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/vector/geojson-sample.js:
--------------------------------------------------------------------------------
1 | var geojsonSample = {
2 | "type": "FeatureCollection",
3 | "features": [
4 | {
5 | "type": "Feature",
6 | "geometry": {
7 | "type": "Point",
8 | "coordinates": [102.0, 0.5]
9 | },
10 | "properties": {
11 | "prop0": "value0",
12 | "color": "blue"
13 | }
14 | },
15 |
16 | {
17 | "type": "Feature",
18 | "geometry": {
19 | "type": "LineString",
20 | "coordinates": [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]
21 | },
22 | "properties": {
23 | "color": "red",
24 | "prop1": 0.0
25 | }
26 | },
27 |
28 | {
29 | "type": "Feature",
30 | "geometry": {
31 | "type": "Polygon",
32 | "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]
33 | },
34 | "properties": {
35 | "color": "green",
36 | "prop1": {
37 | "this": "that"
38 | }
39 | }
40 | },
41 |
42 | {
43 | "type": "Feature",
44 | "geometry": {
45 | "type": "MultiPolygon",
46 | "coordinates": [[[[100.0, 1.5], [100.5, 1.5], [100.5, 2.0], [100.0, 2.0], [100.0, 1.5]]], [[[100.5, 2.0], [100.5, 2.5], [101.0, 2.5], [101.0, 2.0], [100.5, 2.0]]]]
47 | },
48 | "properties": {
49 | "color": "purple"
50 | }
51 | }
52 | ]
53 | };
54 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/vector/rectangle.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
52 |
53 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/vector/vector-mobile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
37 |
38 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/vector/vector-simple.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/debug/vector/vector.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Leaflet debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
37 |
38 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/dist/images/layers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/leaflet/dist/images/layers.png
--------------------------------------------------------------------------------
/public/vendor/leaflet/dist/images/marker-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/leaflet/dist/images/marker-icon.png
--------------------------------------------------------------------------------
/public/vendor/leaflet/dist/images/marker-icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/leaflet/dist/images/marker-icon@2x.png
--------------------------------------------------------------------------------
/public/vendor/leaflet/dist/images/marker-shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/leaflet/dist/images/marker-shadow.png
--------------------------------------------------------------------------------
/public/vendor/leaflet/dist/leaflet.ie.css:
--------------------------------------------------------------------------------
1 | .leaflet-vml-shape {
2 | width: 1px;
3 | height: 1px;
4 | }
5 | .lvml {
6 | behavior: url(#default#VML);
7 | display: inline-block;
8 | position: absolute;
9 | }
10 |
11 | .leaflet-control {
12 | display: inline;
13 | }
14 |
15 | .leaflet-popup-tip {
16 | width: 21px;
17 | _width: 27px;
18 | margin: 0 auto;
19 | _margin-top: -3px;
20 |
21 | filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
22 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
23 | }
24 | .leaflet-popup-tip-container {
25 | margin-top: -1px;
26 | }
27 | .leaflet-popup-content-wrapper, .leaflet-popup-tip {
28 | border: 1px solid #999;
29 | }
30 | .leaflet-popup-content-wrapper {
31 | zoom: 1;
32 | }
33 |
34 | .leaflet-control-zoom,
35 | .leaflet-control-layers {
36 | border: 3px solid #999;
37 | }
38 | .leaflet-control-zoom a {
39 | background-color: #eee;
40 | }
41 | .leaflet-control-zoom a:hover {
42 | background-color: #fff;
43 | }
44 | .leaflet-control-layers-toggle {
45 | }
46 | .leaflet-control-attribution,
47 | .leaflet-control-layers,
48 | .leaflet-control-scale-line {
49 | background: white;
50 | }
51 | .leaflet-zoom-box {
52 | filter: alpha(opacity=50);
53 | }
54 | .leaflet-control-attribution {
55 | border-top: 1px solid #bbb;
56 | border-left: 1px solid #bbb;
57 | }
58 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/jasmine/MIT.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2011 Pivotal Labs
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/LeafletSpec.js:
--------------------------------------------------------------------------------
1 | describe('L#noConflict', function() {
2 | it('should restore the previous L value and return Leaflet namespace', function(){
3 |
4 | expect(L.version).toBeDefined();
5 |
6 | var L2 = L.noConflict();
7 | this.after(function () {
8 | window.L = L2;
9 | });
10 |
11 | expect(L).toEqual('test');
12 | expect(L2.version).toBeDefined();
13 | });
14 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/SpecHelper.js:
--------------------------------------------------------------------------------
1 | function noSpecs() {
2 | xit('should have specs');
3 | }
4 |
5 | if (!Array.prototype.map) {
6 | Array.prototype.map = function(fun /*, thisp */) {
7 | "use strict";
8 |
9 | if (this === void 0 || this === null)
10 | throw new TypeError();
11 |
12 | var t = Object(this);
13 | var len = t.length >>> 0;
14 | if (typeof fun !== "function")
15 | throw new TypeError();
16 |
17 | var res = new Array(len);
18 | var thisp = arguments[1];
19 | for (var i = 0; i < len; i++) {
20 | if (i in t)
21 | res[i] = fun.call(thisp, t[i], i, t);
22 | }
23 |
24 | return res;
25 | };
26 | }
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/control/Control.LayersSpec.js:
--------------------------------------------------------------------------------
1 | describe("Control.Layers", function () {
2 | var map;
3 |
4 | beforeEach(function () {
5 | map = L.map(document.createElement('div'));
6 | });
7 |
8 | describe("baselayerchange event", function () {
9 | it("is fired on input that changes the base layer", function () {
10 | var baseLayers = {"Layer 1": L.tileLayer(), "Layer 2": L.tileLayer()},
11 | layers = L.control.layers(baseLayers).addTo(map),
12 | spy = jasmine.createSpy();
13 |
14 | map.on('baselayerchange', spy)
15 | .whenReady(function(){
16 | happen.click(layers._baseLayersList.getElementsByTagName("input")[0]);
17 |
18 | expect(spy).toHaveBeenCalled();
19 | expect(spy.mostRecentCall.args[0].layer).toBe(baseLayers["Layer 1"]);
20 | });
21 | });
22 |
23 | it("is not fired on input that doesn't change the base layer", function () {
24 | var overlays = {"Marker 1": L.marker([0, 0]), "Marker 2": L.marker([0, 0])},
25 | layers = L.control.layers({}, overlays).addTo(map),
26 | spy = jasmine.createSpy();
27 |
28 | map.on('baselayerchange', spy);
29 | happen.click(layers._overlaysList.getElementsByTagName("input")[0]);
30 |
31 | expect(spy).not.toHaveBeenCalled();
32 | });
33 | });
34 |
35 | describe("updates", function () {
36 | beforeEach(function () {
37 | map.setView([0, 0], 14);
38 | });
39 |
40 | it("when an included layer is addded or removed", function () {
41 | var baseLayer = L.tileLayer(),
42 | overlay = L.marker([0, 0]),
43 | layers = L.control.layers({"Base": baseLayer}, {"Overlay": overlay}).addTo(map);
44 |
45 | spyOn(layers, '_update').andCallThrough();
46 |
47 | map.addLayer(overlay);
48 | map.removeLayer(overlay);
49 |
50 | expect(layers._update).toHaveBeenCalled();
51 | expect(layers._update.callCount).toEqual(2);
52 | });
53 |
54 | it("not when a non-included layer is added or removed", function () {
55 | var baseLayer = L.tileLayer(),
56 | overlay = L.marker([0, 0]),
57 | layers = L.control.layers({"Base": baseLayer}).addTo(map);
58 |
59 | spyOn(layers, '_update').andCallThrough();
60 |
61 | map.addLayer(overlay);
62 | map.removeLayer(overlay);
63 |
64 | expect(layers._update).not.toHaveBeenCalled();
65 | });
66 | });
67 | });
68 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/control/Control.ScaleSpec.js:
--------------------------------------------------------------------------------
1 | describe("Control.Scale", function () {
2 | it("can be added to an unloaded map", function () {
3 | var map = L.map(document.createElement('div'));
4 | new L.Control.Scale().addTo(map);
5 | })
6 | });
7 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/dom/DomUtilSpec.js:
--------------------------------------------------------------------------------
1 | describe('DomUtil', function() {
2 | var el;
3 |
4 | beforeEach(function() {
5 | el = document.createElement('div');
6 | el.style.position = 'absolute';
7 | el.style.top = el.style.left = '-10000px';
8 | document.body.appendChild(el);
9 | });
10 |
11 | afterEach(function() {
12 | document.body.removeChild(el);
13 | });
14 |
15 | describe('#get', function() {
16 | it('should get element by id if the given argument is string', function() {
17 | el.id = 'testId';
18 | expect(L.DomUtil.get(el.id)).toBe(el);
19 | });
20 |
21 | it('should return the element if it is given as an argument', function() {
22 | expect(L.DomUtil.get(el)).toBe(el);
23 | });
24 | });
25 |
26 | describe('#addClass, #removeClass, #hasClass', function() {
27 | it('should has defined class for test element', function() {
28 | el.className = 'bar foo baz ';
29 | expect(L.DomUtil.hasClass(el, 'foo')).toBeTruthy();
30 | expect(L.DomUtil.hasClass(el, 'bar')).toBeTruthy();
31 | expect(L.DomUtil.hasClass(el, 'baz')).toBeTruthy();
32 | expect(L.DomUtil.hasClass(el, 'boo')).toBeFalsy();
33 | });
34 |
35 | it('should properly addClass and removeClass for element', function() {
36 | el.className = '';
37 | L.DomUtil.addClass(el, 'foo');
38 |
39 | expect(el.className).toEqual('foo');
40 | expect(L.DomUtil.hasClass(el, 'foo')).toBeTruthy();
41 |
42 | L.DomUtil.addClass(el, 'bar');
43 | expect(el.className).toEqual('foo bar');
44 | expect(L.DomUtil.hasClass(el, 'foo')).toBeTruthy();
45 |
46 | L.DomUtil.removeClass(el, 'foo');
47 | expect(el.className).toEqual('bar');
48 | expect(L.DomUtil.hasClass(el, 'foo')).toBeFalsy();
49 |
50 | el.className = 'foo bar barz';
51 | L.DomUtil.removeClass(el, 'bar');
52 | expect(el.className).toEqual('foo barz');
53 | })
54 | });
55 |
56 | describe('#setPosition', noSpecs);
57 |
58 | describe('#getStyle', noSpecs);
59 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/geo/LatLngBoundsSpec.js:
--------------------------------------------------------------------------------
1 | describe('LatLngBounds', function() {
2 | var a, c;
3 |
4 | beforeEach(function() {
5 | a = new L.LatLngBounds(
6 | new L.LatLng(14, 12),
7 | new L.LatLng(30, 40));
8 | c = new L.LatLngBounds();
9 | });
10 |
11 | describe('#isValid', function() {
12 | it('should return true if properly set up', function() {
13 | expect(a.isValid()).toBeTruthy();
14 | });
15 | it('should return false if is invalid', function() {
16 | expect(c.isValid()).toBeFalsy();
17 | });
18 | it('should be valid if extended', function() {
19 | c.extend([0, 0]);
20 | expect(c.isValid()).toBeTruthy();
21 | });
22 | });
23 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/geo/LatLngSpec.js:
--------------------------------------------------------------------------------
1 | describe('LatLng', function() {
2 | describe('constructor', function() {
3 | it("should set lat and lng", function() {
4 | var a = new L.LatLng(25, 74);
5 | expect(a.lat).toEqual(25);
6 | expect(a.lng).toEqual(74);
7 |
8 | var a = new L.LatLng(-25, -74);
9 | expect(a.lat).toEqual(-25);
10 | expect(a.lng).toEqual(-74);
11 | });
12 | });
13 |
14 | describe('#equals', function() {
15 | it("should return true if compared objects are equal within a certain margin", function() {
16 | var a = new L.LatLng(10, 20);
17 | var b = new L.LatLng(10 + 1.0E-10, 20 - 1.0E-10);
18 | expect(a.equals(b)).toBe(true);
19 | });
20 |
21 | it("should return false if compared objects are not equal within a certain margin", function() {
22 | var a = new L.LatLng(10, 20);
23 | var b = new L.LatLng(10, 23.3);
24 | expect(a.equals(b)).toBe(false);
25 | });
26 | });
27 |
28 | describe('#wrap', function () {
29 | it("#wrap should wrap longitude to lie between -180 and 180 by default", function() {
30 | var a = new L.LatLng(0, 190).wrap().lng;
31 | expect(a).toEqual(-170);
32 |
33 | var b = new L.LatLng(0, 360).wrap().lng;
34 | expect(b).toEqual(0);
35 |
36 | var c = new L.LatLng(0, 380).wrap().lng;
37 | expect(c).toEqual(20);
38 |
39 | var d = new L.LatLng(0, -190).wrap().lng;
40 | expect(d).toEqual(170);
41 |
42 | var e = new L.LatLng(0, -360).wrap().lng;
43 | expect(e).toEqual(0);
44 |
45 | var f = new L.LatLng(0, -380).wrap().lng;
46 | expect(f).toEqual(-20);
47 |
48 | var g = new L.LatLng(0, 90).wrap().lng;
49 | expect(g).toEqual(90);
50 |
51 | var h = new L.LatLng(0, 180).wrap().lng;
52 | expect(h).toEqual(180);
53 | });
54 |
55 | it("#wrap should wrap longitude within the given range", function() {
56 | var a = new L.LatLng(0, 190).wrap(-100, 100).lng;
57 | expect(a).toEqual(-10);
58 | });
59 |
60 | })
61 | });
62 |
63 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/geo/ProjectionSpec.js:
--------------------------------------------------------------------------------
1 | xdescribe("Projection.Mercator", function() {
2 | var p = L.Projection.Mercator;
3 |
4 | beforeEach(function() {
5 | function almostEqual(a, b, p) {
6 | return Math.abs(a - b) <= (p || 1.0E-12);
7 | };
8 | this.addMatchers({
9 | toAlmostEqual: function(expected, margin) {
10 | var p1 = this.actual,
11 | p2 = expected;
12 | return almostEqual(p1.x, p2.x, margin) && almostEqual(p1.y, p2.y, margin);
13 | }
14 | });
15 | });
16 |
17 |
18 | describe("#project", function() {
19 | it("should do projection properly", function() {
20 | //edge cases
21 | expect(p.project(new L.LatLng(0, 0))).toAlmostEqual(new L.Point(0, 0));
22 | expect(p.project(new L.LatLng(90, 180))).toAlmostEqual(new L.Point(-Math.PI, Math.PI));
23 | expect(p.project(new L.LatLng(-90, -180))).toAlmostEqual(new L.Point(-Math.PI, -Math.PI));
24 |
25 | expect(p.project(new L.LatLng(50, 30))).toAlmostEqual(new L.Point(0.523598775598, 1.010683188683));
26 | });
27 | });
28 |
29 | describe("#unproject", function() {
30 | it("should do unprojection properly", function() {
31 | function pr(point) {
32 | return p.project(p.unproject(point));
33 | }
34 |
35 | expect(pr(new L.Point(0, 0))).toAlmostEqual(new L.Point(0, 0));
36 | expect(pr(new L.Point(-Math.PI, Math.PI))).toAlmostEqual(new L.Point(-Math.PI, Math.PI));
37 | expect(pr(new L.Point(-Math.PI, -Math.PI))).toAlmostEqual(new L.Point(-Math.PI, -Math.PI));
38 |
39 | expect(pr(new L.Point(0.523598775598, 1.010683188683))).toAlmostEqual(new L.Point(0.523598775598, 1.010683188683));
40 | });
41 | });
42 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/geometry/BoundsSpec.js:
--------------------------------------------------------------------------------
1 | describe('Bounds', function() {
2 | var a, b, c;
3 |
4 | beforeEach(function() {
5 | a = new L.Bounds(
6 | new L.Point(14, 12),
7 | new L.Point(30, 40));
8 | b = new L.Bounds([
9 | new L.Point(20, 12),
10 | new L.Point(14, 20),
11 | new L.Point(30, 40)
12 | ]);
13 | c = new L.Bounds();
14 | });
15 |
16 | describe('constructor', function() {
17 | it('should create bounds with proper min & max on (Point, Point)', function() {
18 | expect(a.min).toEqual(new L.Point(14, 12));
19 | expect(a.max).toEqual(new L.Point(30, 40));
20 | });
21 | it('should create bounds with proper min & max on (Point[])', function() {
22 | expect(b.min).toEqual(new L.Point(14, 12));
23 | expect(b.max).toEqual(new L.Point(30, 40));
24 | });
25 | });
26 |
27 | describe('#extend', function() {
28 | it('should extend the bounds to contain the given point', function() {
29 | a.extend(new L.Point(50, 20));
30 | expect(a.min).toEqual(new L.Point(14, 12));
31 | expect(a.max).toEqual(new L.Point(50, 40));
32 |
33 | b.extend(new L.Point(25, 50));
34 | expect(b.min).toEqual(new L.Point(14, 12));
35 | expect(b.max).toEqual(new L.Point(30, 50));
36 | });
37 | });
38 |
39 | describe('#getCenter', function() {
40 | it('should return the center point', function() {
41 | expect(a.getCenter()).toEqual(new L.Point(22, 26));
42 | });
43 | });
44 |
45 | describe('#contains', function() {
46 | it('should contains other bounds or point', function() {
47 | a.extend(new L.Point(50, 10));
48 | expect(a.contains(b)).toBeTruthy();
49 | expect(b.contains(a)).toBeFalsy();
50 | expect(a.contains(new L.Point(24, 25))).toBeTruthy();
51 | expect(a.contains(new L.Point(54, 65))).toBeFalsy();
52 | });
53 | });
54 |
55 | describe('#isValid', function() {
56 | it('should return true if properly set up', function() {
57 | expect(a.isValid()).toBeTruthy();
58 | });
59 | it('should return false if is invalid', function() {
60 | expect(c.isValid()).toBeFalsy();
61 | });
62 | it('should be valid if extended', function() {
63 | c.extend([0, 0]);
64 | expect(c.isValid()).toBeTruthy();
65 | });
66 | });
67 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/geometry/PointSpec.js:
--------------------------------------------------------------------------------
1 | describe("Point", function() {
2 |
3 | describe('constructor', function() {
4 |
5 | it("should create a point with the given x and y", function() {
6 | var p = new L.Point(1.5, 2.5);
7 | expect(p.x).toEqual(1.5);
8 | expect(p.y).toEqual(2.5);
9 | });
10 |
11 | it("should round the given x and y if the third argument is true", function() {
12 | var p = new L.Point(1.3, 2.7, true);
13 | expect(p.x).toEqual(1);
14 | expect(p.y).toEqual(3);
15 | });
16 | });
17 |
18 | describe('#subtract', function() {
19 | it('should subtract the given point from this one', function() {
20 | var a = new L.Point(50, 30),
21 | b = new L.Point(20, 10);
22 | expect(a.subtract(b)).toEqual(new L.Point(30, 20));
23 | });
24 | });
25 |
26 | describe('#add', function() {
27 | it('should add the given point to this one', function() {
28 | expect(new L.Point(50, 30).add(new L.Point(20, 10))).toEqual(new L.Point(70, 40));
29 | });
30 | });
31 |
32 | describe('#divideBy', function() {
33 | it('should divide this point by the given amount', function() {
34 | expect(new L.Point(50, 30).divideBy(5)).toEqual(new L.Point(10, 6));
35 | });
36 | });
37 |
38 | describe('#multiplyBy', function() {
39 | it('should multiply this point by the given amount', function() {
40 | expect(new L.Point(50, 30).multiplyBy(2)).toEqual(new L.Point(100, 60));
41 | });
42 | });
43 |
44 | describe('#distanceTo', noSpecs);
45 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/geometry/TransformationSpec.js:
--------------------------------------------------------------------------------
1 | describe("Transformation", function() {
2 | var t, p;
3 |
4 | beforeEach(function() {
5 | t = new L.Transformation(1, 2, 3, 4);
6 | p = new L.Point(10, 20);
7 | });
8 |
9 | it("#transform should perform a transformation", function() {
10 | var p2 = t.transform(p, 2);
11 | expect(p2).toEqual(new L.Point(24, 128));
12 | });
13 |
14 | it("#untransform should perform a reverse transformation", function() {
15 | var p2 = t.transform(p, 2);
16 | var p3 = t.untransform(p2, 2);
17 | expect(p3).toEqual(p);
18 | });
19 | });
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/layer/vector/CircleSpec.js:
--------------------------------------------------------------------------------
1 | describe('Circle', function () {
2 | describe('#getBounds', function () {
3 |
4 | var circle;
5 |
6 | beforeEach(function () {
7 | circle = L.circle([50, 30], 200);
8 | });
9 |
10 | it('should return correct bounds', function () {
11 | var bounds = circle.getBounds();
12 |
13 | expect(bounds.getSouthWest().equals([49.998203369, 29.997204939])).toBeTruthy();
14 | expect(bounds.getNorthEast().equals([50.001796631, 30.002795061])).toBeTruthy();
15 | });
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js:
--------------------------------------------------------------------------------
1 | describe('PolylineGeometry', function() {
2 |
3 | var c = document.createElement('div');
4 | c.style.width = '400px';
5 | c.style.height = '400px';
6 | var map = new L.Map(c);
7 | map.setView(new L.LatLng(55.8, 37.6), 6);
8 |
9 | describe("#distanceTo", function() {
10 | it("should calculate correct distances to points", function() {
11 | var p1 = map.latLngToLayerPoint(new L.LatLng(55.8, 37.6));
12 | var p2 = map.latLngToLayerPoint(new L.LatLng(57.123076977278, 44.861962891635));
13 | var latlngs = [[56.485503424111, 35.545556640339], [55.972522915346, 36.116845702918], [55.502459116923, 34.930322265253], [55.31534617509, 38.973291015816]]
14 | .map(function(ll) {
15 | return new L.LatLng(ll[0], ll[1]);
16 | });
17 | var polyline = new L.Polyline([], {
18 | 'noClip': true
19 | });
20 | map.addLayer(polyline);
21 |
22 | expect(polyline.closestLayerPoint(p1)).toEqual(null);
23 |
24 | polyline.setLatLngs(latlngs);
25 | var point = polyline.closestLayerPoint(p1);
26 | expect(point).not.toEqual(null);
27 | expect(point.distance).not.toEqual(Infinity);
28 | expect(point.distance).not.toEqual(NaN);
29 |
30 | var point2 = polyline.closestLayerPoint(p2);
31 |
32 | expect(point.distance).toBeLessThan(point2.distance);
33 | });
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/spec/suites/map/MapSpec.js:
--------------------------------------------------------------------------------
1 | describe("Map", function () {
2 | describe("#whenReady", function () {
3 | describe("when the map has not yet been loaded", function () {
4 | it("calls the callback when the map is loaded", function () {
5 | var map = L.map(document.createElement('div')),
6 | spy = jasmine.createSpy();
7 |
8 | map.whenReady(spy);
9 | expect(spy).not.toHaveBeenCalled();
10 |
11 | map.setView([0, 0], 1);
12 | expect(spy).toHaveBeenCalled();
13 | });
14 | });
15 |
16 | describe("when the map has already been loaded", function () {
17 | it("calls the callback immediately", function () {
18 | var map = L.map(document.createElement('div')),
19 | spy = jasmine.createSpy();
20 |
21 | map.setView([0, 0], 1);
22 | map.whenReady(spy);
23 |
24 | expect(spy).toHaveBeenCalled();
25 | });
26 | });
27 | });
28 |
29 | describe("#getBounds", function () {
30 | it("is safe to call from within a moveend callback during initial "
31 | + "load (#1027)", function () {
32 | var c = document.createElement('div'),
33 | map = L.map(c);
34 |
35 | map.on("moveend", function () {
36 | map.getBounds();
37 | });
38 |
39 | map.setView([51.505, -0.09], 13);
40 | });
41 | });
42 |
43 | describe("#getMinZoom and #getMaxZoom", function () {
44 | it("The minZoom and maxZoom options overrides any"
45 | + " minZoom and maxZoom set on layers", function () {
46 | var c = document.createElement('div'),
47 | map = L.map(c, { minZoom: 5, maxZoom: 10 });
48 | L.tileLayer("{z}{x}{y}", { minZoom:0, maxZoom: 10 }).addTo(map);
49 | L.tileLayer("{z}{x}{y}", { minZoom:5, maxZoom: 15 }).addTo(map);
50 | expect(map.getMinZoom()).toBe(5);
51 | expect(map.getMaxZoom()).toBe(10);
52 | });
53 | });
54 | });
55 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/Leaflet.js:
--------------------------------------------------------------------------------
1 | /*
2 | * The L namespace contains all Leaflet classes and functions.
3 | * This code allows you to handle any possible namespace conflicts.
4 | */
5 |
6 | var L, originalL;
7 |
8 | if (typeof exports !== undefined + '') {
9 | L = exports;
10 | } else {
11 | originalL = window.L;
12 | L = {};
13 |
14 | L.noConflict = function () {
15 | window.L = originalL;
16 | return this;
17 | };
18 |
19 | window.L = L;
20 | }
21 |
22 | L.version = '0.5.1';
23 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/control/Control.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Control is a base class for implementing map controls. Handles positioning.
3 | * All other controls extend from this class.
4 | */
5 |
6 | L.Control = L.Class.extend({
7 | options: {
8 | position: 'topright'
9 | },
10 |
11 | initialize: function (options) {
12 | L.setOptions(this, options);
13 | },
14 |
15 | getPosition: function () {
16 | return this.options.position;
17 | },
18 |
19 | setPosition: function (position) {
20 | var map = this._map;
21 |
22 | if (map) {
23 | map.removeControl(this);
24 | }
25 |
26 | this.options.position = position;
27 |
28 | if (map) {
29 | map.addControl(this);
30 | }
31 |
32 | return this;
33 | },
34 |
35 | addTo: function (map) {
36 | this._map = map;
37 |
38 | var container = this._container = this.onAdd(map),
39 | pos = this.getPosition(),
40 | corner = map._controlCorners[pos];
41 |
42 | L.DomUtil.addClass(container, 'leaflet-control');
43 |
44 | if (pos.indexOf('bottom') !== -1) {
45 | corner.insertBefore(container, corner.firstChild);
46 | } else {
47 | corner.appendChild(container);
48 | }
49 |
50 | return this;
51 | },
52 |
53 | removeFrom: function (map) {
54 | var pos = this.getPosition(),
55 | corner = map._controlCorners[pos];
56 |
57 | corner.removeChild(this._container);
58 | this._map = null;
59 |
60 | if (this.onRemove) {
61 | this.onRemove(map);
62 | }
63 |
64 | return this;
65 | }
66 | });
67 |
68 | L.control = function (options) {
69 | return new L.Control(options);
70 | };
71 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/copyright.js:
--------------------------------------------------------------------------------
1 | /*
2 | Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com
3 | (c) 2010-2013, Vladimir Agafonkin, CloudMade
4 | */
5 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/core/Handler.js:
--------------------------------------------------------------------------------
1 | /*
2 | L.Handler is a base class for handler classes that are used internally to inject
3 | interaction features like dragging to classes like Map and Marker.
4 | */
5 |
6 | L.Handler = L.Class.extend({
7 | initialize: function (map) {
8 | this._map = map;
9 | },
10 |
11 | enable: function () {
12 | if (this._enabled) { return; }
13 |
14 | this._enabled = true;
15 | this.addHooks();
16 | },
17 |
18 | disable: function () {
19 | if (!this._enabled) { return; }
20 |
21 | this._enabled = false;
22 | this.removeHooks();
23 | },
24 |
25 | enabled: function () {
26 | return !!this._enabled;
27 | }
28 | });
29 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/dom/PosAnimation.Timer.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.PosAnimation fallback implementation that powers Leaflet pan animations
3 | * in browsers that don't support CSS3 Transitions.
4 | */
5 |
6 | L.PosAnimation = L.DomUtil.TRANSITION ? L.PosAnimation : L.PosAnimation.extend({
7 |
8 | run: function (el, newPos, duration, easeLinearity) { // (HTMLElement, Point[, Number, Number])
9 | this.stop();
10 |
11 | this._el = el;
12 | this._inProgress = true;
13 | this._duration = duration || 0.25;
14 | this._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);
15 |
16 | this._startPos = L.DomUtil.getPosition(el);
17 | this._offset = newPos.subtract(this._startPos);
18 | this._startTime = +new Date();
19 |
20 | this.fire('start');
21 |
22 | this._animate();
23 | },
24 |
25 | stop: function () {
26 | if (!this._inProgress) { return; }
27 |
28 | this._step();
29 | this._complete();
30 | },
31 |
32 | _animate: function () {
33 | // animation loop
34 | this._animId = L.Util.requestAnimFrame(this._animate, this);
35 | this._step();
36 | },
37 |
38 | _step: function () {
39 | var elapsed = (+new Date()) - this._startTime,
40 | duration = this._duration * 1000;
41 |
42 | if (elapsed < duration) {
43 | this._runFrame(this._easeOut(elapsed / duration));
44 | } else {
45 | this._runFrame(1);
46 | this._complete();
47 | }
48 | },
49 |
50 | _runFrame: function (progress) {
51 | var pos = this._startPos.add(this._offset.multiplyBy(progress));
52 | L.DomUtil.setPosition(this._el, pos);
53 |
54 | this.fire('step');
55 | },
56 |
57 | _complete: function () {
58 | L.Util.cancelAnimFrame(this._animId);
59 |
60 | this._inProgress = false;
61 | this.fire('end');
62 | },
63 |
64 | _easeOut: function (t) {
65 | return 1 - Math.pow(1 - t, this._easeOutPower);
66 | }
67 | });
68 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/crs/CRS.EPSG3395.js:
--------------------------------------------------------------------------------
1 |
2 | L.CRS.EPSG3395 = L.extend({}, L.CRS, {
3 | code: 'EPSG:3395',
4 |
5 | projection: L.Projection.Mercator,
6 |
7 | transformation: (function () {
8 | var m = L.Projection.Mercator,
9 | r = m.R_MAJOR,
10 | r2 = m.R_MINOR;
11 |
12 | return new L.Transformation(0.5 / (Math.PI * r), 0.5, -0.5 / (Math.PI * r2), 0.5);
13 | }())
14 | });
15 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/crs/CRS.EPSG3857.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.CRS.EPSG3857 (Spherical Mercator) is the most common CRS for web mapping
3 | * and is used by Leaflet by default.
4 | */
5 |
6 | L.CRS.EPSG3857 = L.extend({}, L.CRS, {
7 | code: 'EPSG:3857',
8 |
9 | projection: L.Projection.SphericalMercator,
10 | transformation: new L.Transformation(0.5 / Math.PI, 0.5, -0.5 / Math.PI, 0.5),
11 |
12 | project: function (latlng) { // (LatLng) -> Point
13 | var projectedPoint = this.projection.project(latlng),
14 | earthRadius = 6378137;
15 | return projectedPoint.multiplyBy(earthRadius);
16 | }
17 | });
18 |
19 | L.CRS.EPSG900913 = L.extend({}, L.CRS.EPSG3857, {
20 | code: 'EPSG:900913'
21 | });
22 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/crs/CRS.EPSG4326.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.CRS.EPSG4326 is a CRS popular among advanced GIS specialists.
3 | */
4 |
5 | L.CRS.EPSG4326 = L.extend({}, L.CRS, {
6 | code: 'EPSG:4326',
7 |
8 | projection: L.Projection.LonLat,
9 | transformation: new L.Transformation(1 / 360, 0.5, -1 / 360, 0.5)
10 | });
11 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/crs/CRS.Simple.js:
--------------------------------------------------------------------------------
1 | /*
2 | * A simple CRS that can be used for flat non-Earth maps like panoramas or game maps.
3 | */
4 |
5 | L.CRS.Simple = L.extend({}, L.CRS, {
6 | projection: L.Projection.LonLat,
7 | transformation: new L.Transformation(1, 0, -1, 0),
8 |
9 | scale: function (zoom) {
10 | return Math.pow(2, zoom);
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/crs/CRS.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.CRS is a base object for all defined CRS (Coordinate Reference Systems) in Leaflet.
3 | */
4 |
5 | L.CRS = {
6 | latLngToPoint: function (latlng, zoom) { // (LatLng, Number) -> Point
7 | var projectedPoint = this.projection.project(latlng),
8 | scale = this.scale(zoom);
9 |
10 | return this.transformation._transform(projectedPoint, scale);
11 | },
12 |
13 | pointToLatLng: function (point, zoom) { // (Point, Number[, Boolean]) -> LatLng
14 | var scale = this.scale(zoom),
15 | untransformedPoint = this.transformation.untransform(point, scale);
16 |
17 | return this.projection.unproject(untransformedPoint);
18 | },
19 |
20 | project: function (latlng) {
21 | return this.projection.project(latlng);
22 | },
23 |
24 | scale: function (zoom) {
25 | return 256 * Math.pow(2, zoom);
26 | }
27 | };
28 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/projection/Projection.LonLat.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Simple equirectangular (Plate Carree) projection, used by CRS like EPSG:4326 and Simple.
3 | */
4 |
5 | L.Projection.LonLat = {
6 | project: function (latlng) {
7 | return new L.Point(latlng.lng, latlng.lat);
8 | },
9 |
10 | unproject: function (point) {
11 | return new L.LatLng(point.y, point.x);
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/projection/Projection.Mercator.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Mercator projection that takes into account that the Earth is not a perfect sphere.
3 | * Less popular than spherical mercator; used by projections like EPSG:3395.
4 | */
5 |
6 | L.Projection.Mercator = {
7 | MAX_LATITUDE: 85.0840591556,
8 |
9 | R_MINOR: 6356752.3142,
10 | R_MAJOR: 6378137,
11 |
12 | project: function (latlng) { // (LatLng) -> Point
13 | var d = L.LatLng.DEG_TO_RAD,
14 | max = this.MAX_LATITUDE,
15 | lat = Math.max(Math.min(max, latlng.lat), -max),
16 | r = this.R_MAJOR,
17 | r2 = this.R_MINOR,
18 | x = latlng.lng * d * r,
19 | y = lat * d,
20 | tmp = r2 / r,
21 | eccent = Math.sqrt(1.0 - tmp * tmp),
22 | con = eccent * Math.sin(y);
23 |
24 | con = Math.pow((1 - con) / (1 + con), eccent * 0.5);
25 |
26 | var ts = Math.tan(0.5 * ((Math.PI * 0.5) - y)) / con;
27 | y = -r2 * Math.log(ts);
28 |
29 | return new L.Point(x, y);
30 | },
31 |
32 | unproject: function (point) { // (Point, Boolean) -> LatLng
33 | var d = L.LatLng.RAD_TO_DEG,
34 | r = this.R_MAJOR,
35 | r2 = this.R_MINOR,
36 | lng = point.x * d / r,
37 | tmp = r2 / r,
38 | eccent = Math.sqrt(1 - (tmp * tmp)),
39 | ts = Math.exp(- point.y / r2),
40 | phi = (Math.PI / 2) - 2 * Math.atan(ts),
41 | numIter = 15,
42 | tol = 1e-7,
43 | i = numIter,
44 | dphi = 0.1,
45 | con;
46 |
47 | while ((Math.abs(dphi) > tol) && (--i > 0)) {
48 | con = eccent * Math.sin(phi);
49 | dphi = (Math.PI / 2) - 2 * Math.atan(ts *
50 | Math.pow((1.0 - con) / (1.0 + con), 0.5 * eccent)) - phi;
51 | phi += dphi;
52 | }
53 |
54 | return new L.LatLng(phi * d, lng);
55 | }
56 | };
57 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/projection/Projection.SphericalMercator.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Spherical Mercator is the most popular map projection, used by EPSG:3857 CRS used by default.
3 | */
4 |
5 | L.Projection.SphericalMercator = {
6 | MAX_LATITUDE: 85.0511287798,
7 |
8 | project: function (latlng) { // (LatLng) -> Point
9 | var d = L.LatLng.DEG_TO_RAD,
10 | max = this.MAX_LATITUDE,
11 | lat = Math.max(Math.min(max, latlng.lat), -max),
12 | x = latlng.lng * d,
13 | y = lat * d;
14 |
15 | y = Math.log(Math.tan((Math.PI / 4) + (y / 2)));
16 |
17 | return new L.Point(x, y);
18 | },
19 |
20 | unproject: function (point) { // (Point, Boolean) -> LatLng
21 | var d = L.LatLng.RAD_TO_DEG,
22 | lng = point.x * d,
23 | lat = (2 * Math.atan(Math.exp(point.y)) - (Math.PI / 2)) * d;
24 |
25 | return new L.LatLng(lat, lng);
26 | }
27 | };
28 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geo/projection/Projection.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Projection contains various geographical projections used by CRS classes.
3 | */
4 |
5 | L.Projection = {};
6 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geometry/PolyUtil.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.PolyUtil contains utility functions for polygons (clipping, etc.).
3 | */
4 |
5 | /*jshint bitwise:false */ // allow bitwise operations here
6 |
7 | L.PolyUtil = {};
8 |
9 | /*
10 | * Sutherland-Hodgeman polygon clipping algorithm.
11 | * Used to avoid rendering parts of a polygon that are not currently visible.
12 | */
13 | L.PolyUtil.clipPolygon = function (points, bounds) {
14 | var clippedPoints,
15 | edges = [1, 4, 2, 8],
16 | i, j, k,
17 | a, b,
18 | len, edge, p,
19 | lu = L.LineUtil;
20 |
21 | for (i = 0, len = points.length; i < len; i++) {
22 | points[i]._code = lu._getBitCode(points[i], bounds);
23 | }
24 |
25 | // for each edge (left, bottom, right, top)
26 | for (k = 0; k < 4; k++) {
27 | edge = edges[k];
28 | clippedPoints = [];
29 |
30 | for (i = 0, len = points.length, j = len - 1; i < len; j = i++) {
31 | a = points[i];
32 | b = points[j];
33 |
34 | // if a is inside the clip window
35 | if (!(a._code & edge)) {
36 | // if b is outside the clip window (a->b goes out of screen)
37 | if (b._code & edge) {
38 | p = lu._getEdgeIntersection(b, a, edge, bounds);
39 | p._code = lu._getBitCode(p, bounds);
40 | clippedPoints.push(p);
41 | }
42 | clippedPoints.push(a);
43 |
44 | // else if b is inside the clip window (a->b enters the screen)
45 | } else if (!(b._code & edge)) {
46 | p = lu._getEdgeIntersection(b, a, edge, bounds);
47 | p._code = lu._getBitCode(p, bounds);
48 | clippedPoints.push(p);
49 | }
50 | }
51 | points = clippedPoints;
52 | }
53 |
54 | return points;
55 | };
56 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/geometry/Transformation.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Transformation is an utility class to perform simple point transformations through a 2d-matrix.
3 | */
4 |
5 | L.Transformation = function (a, b, c, d) {
6 | this._a = a;
7 | this._b = b;
8 | this._c = c;
9 | this._d = d;
10 | };
11 |
12 | L.Transformation.prototype = {
13 | transform: function (point, scale) { // (Point, Number) -> Point
14 | return this._transform(point.clone(), scale);
15 | },
16 |
17 | // destructive transform (faster)
18 | _transform: function (point, scale) {
19 | scale = scale || 1;
20 | point.x = scale * (this._a * point.x + this._b);
21 | point.y = scale * (this._c * point.y + this._d);
22 | return point;
23 | },
24 |
25 | untransform: function (point, scale) {
26 | scale = scale || 1;
27 | return new L.Point(
28 | (point.x / scale - this._b) / this._a,
29 | (point.y / scale - this._d) / this._c);
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/FeatureGroup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.FeatureGroup extends L.LayerGroup by introducing mouse events and additional methods
3 | * shared between a group of interactive layers (like vectors or markers).
4 | */
5 |
6 | L.FeatureGroup = L.LayerGroup.extend({
7 | includes: L.Mixin.Events,
8 |
9 | statics: {
10 | EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu'
11 | },
12 |
13 | addLayer: function (layer) {
14 | if (this._layers[L.stamp(layer)]) {
15 | return this;
16 | }
17 |
18 | layer.on(L.FeatureGroup.EVENTS, this._propagateEvent, this);
19 |
20 | L.LayerGroup.prototype.addLayer.call(this, layer);
21 |
22 | if (this._popupContent && layer.bindPopup) {
23 | layer.bindPopup(this._popupContent, this._popupOptions);
24 | }
25 |
26 | return this.fire('layeradd', {layer: layer});
27 | },
28 |
29 | removeLayer: function (layer) {
30 | layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
31 |
32 | L.LayerGroup.prototype.removeLayer.call(this, layer);
33 |
34 |
35 | if (this._popupContent) {
36 | this.invoke('unbindPopup');
37 | }
38 |
39 | return this.fire('layerremove', {layer: layer});
40 | },
41 |
42 | bindPopup: function (content, options) {
43 | this._popupContent = content;
44 | this._popupOptions = options;
45 | return this.invoke('bindPopup', content, options);
46 | },
47 |
48 | setStyle: function (style) {
49 | return this.invoke('setStyle', style);
50 | },
51 |
52 | bringToFront: function () {
53 | return this.invoke('bringToFront');
54 | },
55 |
56 | bringToBack: function () {
57 | return this.invoke('bringToBack');
58 | },
59 |
60 | getBounds: function () {
61 | var bounds = new L.LatLngBounds();
62 |
63 | this.eachLayer(function (layer) {
64 | bounds.extend(layer instanceof L.Marker ? layer.getLatLng() : layer.getBounds());
65 | });
66 |
67 | return bounds;
68 | },
69 |
70 | _propagateEvent: function (e) {
71 | e.layer = e.target;
72 | e.target = this;
73 |
74 | this.fire(e.type, e);
75 | }
76 | });
77 |
78 | L.featureGroup = function (layers) {
79 | return new L.FeatureGroup(layers);
80 | };
81 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/LayerGroup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.LayerGroup is a class to combine several layers into one so that
3 | * you can manipulate the group (e.g. add/remove it) as one layer.
4 | */
5 |
6 | L.LayerGroup = L.Class.extend({
7 | initialize: function (layers) {
8 | this._layers = {};
9 |
10 | var i, len;
11 |
12 | if (layers) {
13 | for (i = 0, len = layers.length; i < len; i++) {
14 | this.addLayer(layers[i]);
15 | }
16 | }
17 | },
18 |
19 | addLayer: function (layer) {
20 | var id = L.stamp(layer);
21 |
22 | this._layers[id] = layer;
23 |
24 | if (this._map) {
25 | this._map.addLayer(layer);
26 | }
27 |
28 | return this;
29 | },
30 |
31 | removeLayer: function (layer) {
32 | var id = L.stamp(layer);
33 |
34 | delete this._layers[id];
35 |
36 | if (this._map) {
37 | this._map.removeLayer(layer);
38 | }
39 |
40 | return this;
41 | },
42 |
43 | clearLayers: function () {
44 | this.eachLayer(this.removeLayer, this);
45 | return this;
46 | },
47 |
48 | invoke: function (methodName) {
49 | var args = Array.prototype.slice.call(arguments, 1),
50 | i, layer;
51 |
52 | for (i in this._layers) {
53 | if (this._layers.hasOwnProperty(i)) {
54 | layer = this._layers[i];
55 |
56 | if (layer[methodName]) {
57 | layer[methodName].apply(layer, args);
58 | }
59 | }
60 | }
61 |
62 | return this;
63 | },
64 |
65 | onAdd: function (map) {
66 | this._map = map;
67 | this.eachLayer(map.addLayer, map);
68 | },
69 |
70 | onRemove: function (map) {
71 | this.eachLayer(map.removeLayer, map);
72 | this._map = null;
73 | },
74 |
75 | addTo: function (map) {
76 | map.addLayer(this);
77 | return this;
78 | },
79 |
80 | eachLayer: function (method, context) {
81 | for (var i in this._layers) {
82 | if (this._layers.hasOwnProperty(i)) {
83 | method.call(context, this._layers[i]);
84 | }
85 | }
86 | },
87 |
88 | setZIndex: function (zIndex) {
89 | return this.invoke('setZIndex', zIndex);
90 | }
91 | });
92 |
93 | L.layerGroup = function (layers) {
94 | return new L.LayerGroup(layers);
95 | };
96 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/marker/DivIcon.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.DivIcon is a lightweight HTML-based icon class (as opposed to the image-based L.Icon)
3 | * to use with L.Marker.
4 | */
5 |
6 | L.DivIcon = L.Icon.extend({
7 | options: {
8 | iconSize: new L.Point(12, 12), // also can be set through CSS
9 | /*
10 | iconAnchor: (Point)
11 | popupAnchor: (Point)
12 | html: (String)
13 | bgPos: (Point)
14 | */
15 | className: 'leaflet-div-icon'
16 | },
17 |
18 | createIcon: function () {
19 | var div = document.createElement('div'),
20 | options = this.options;
21 |
22 | if (options.html) {
23 | div.innerHTML = options.html;
24 | }
25 |
26 | if (options.bgPos) {
27 | div.style.backgroundPosition =
28 | (-options.bgPos.x) + 'px ' + (-options.bgPos.y) + 'px';
29 | }
30 |
31 | this._setIconStyles(div, 'icon');
32 | return div;
33 | },
34 |
35 | createShadow: function () {
36 | return null;
37 | }
38 | });
39 |
40 | L.divIcon = function (options) {
41 | return new L.DivIcon(options);
42 | };
43 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/marker/Icon.Default.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Icon.Default is the blue marker icon used by default in Leaflet.
3 | */
4 |
5 | L.Icon.Default = L.Icon.extend({
6 |
7 | options: {
8 | iconSize: new L.Point(25, 41),
9 | iconAnchor: new L.Point(12, 41),
10 | popupAnchor: new L.Point(1, -34),
11 |
12 | shadowSize: new L.Point(41, 41)
13 | },
14 |
15 | _getIconUrl: function (name) {
16 | var key = name + 'Url';
17 |
18 | if (this.options[key]) {
19 | return this.options[key];
20 | }
21 |
22 | if (L.Browser.retina && name === 'icon') {
23 | name += '@2x';
24 | }
25 |
26 | var path = L.Icon.Default.imagePath;
27 |
28 | if (!path) {
29 | throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");
30 | }
31 |
32 | return path + '/marker-' + name + '.png';
33 | }
34 | });
35 |
36 | L.Icon.Default.imagePath = (function () {
37 | var scripts = document.getElementsByTagName('script'),
38 | leafletRe = /\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;
39 |
40 | var i, len, src, matches;
41 |
42 | for (i = 0, len = scripts.length; i < len; i++) {
43 | src = scripts[i].src;
44 | matches = src.match(leafletRe);
45 |
46 | if (matches) {
47 | return src.split(leafletRe)[0] + '/images';
48 | }
49 | }
50 | }());
51 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/marker/Marker.Drag.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.
3 | */
4 |
5 | L.Handler.MarkerDrag = L.Handler.extend({
6 | initialize: function (marker) {
7 | this._marker = marker;
8 | },
9 |
10 | addHooks: function () {
11 | var icon = this._marker._icon;
12 | if (!this._draggable) {
13 | this._draggable = new L.Draggable(icon, icon)
14 | .on('dragstart', this._onDragStart, this)
15 | .on('drag', this._onDrag, this)
16 | .on('dragend', this._onDragEnd, this);
17 | }
18 | this._draggable.enable();
19 | },
20 |
21 | removeHooks: function () {
22 | this._draggable.disable();
23 | },
24 |
25 | moved: function () {
26 | return this._draggable && this._draggable._moved;
27 | },
28 |
29 | _onDragStart: function () {
30 | this._marker
31 | .closePopup()
32 | .fire('movestart')
33 | .fire('dragstart');
34 | },
35 |
36 | _onDrag: function () {
37 | var marker = this._marker,
38 | shadow = marker._shadow,
39 | iconPos = L.DomUtil.getPosition(marker._icon),
40 | latlng = marker._map.layerPointToLatLng(iconPos);
41 |
42 | // update shadow position
43 | if (shadow) {
44 | L.DomUtil.setPosition(shadow, iconPos);
45 | }
46 |
47 | marker._latlng = latlng;
48 |
49 | marker
50 | .fire('move', {latlng: latlng})
51 | .fire('drag');
52 | },
53 |
54 | _onDragEnd: function () {
55 | this._marker
56 | .fire('moveend')
57 | .fire('dragend');
58 | }
59 | });
60 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/marker/Marker.Popup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Popup extension to L.Marker, adding popup-related methods.
3 | */
4 |
5 | L.Marker.include({
6 | openPopup: function () {
7 | if (this._popup && this._map) {
8 | this._popup.setLatLng(this._latlng);
9 | this._map.openPopup(this._popup);
10 | }
11 |
12 | return this;
13 | },
14 |
15 | closePopup: function () {
16 | if (this._popup) {
17 | this._popup._close();
18 | }
19 | return this;
20 | },
21 |
22 | bindPopup: function (content, options) {
23 | var anchor = L.point(this.options.icon.options.popupAnchor) || new L.Point(0, 0);
24 |
25 | anchor = anchor.add(L.Popup.prototype.options.offset);
26 |
27 | if (options && options.offset) {
28 | anchor = anchor.add(options.offset);
29 | }
30 |
31 | options = L.extend({offset: anchor}, options);
32 |
33 | if (!this._popup) {
34 | this
35 | .on('click', this.openPopup, this)
36 | .on('remove', this.closePopup, this)
37 | .on('move', this._movePopup, this);
38 | }
39 |
40 | this._popup = new L.Popup(options, this)
41 | .setContent(content);
42 |
43 | return this;
44 | },
45 |
46 | unbindPopup: function () {
47 | if (this._popup) {
48 | this._popup = null;
49 | this
50 | .off('click', this.openPopup)
51 | .off('remove', this.closePopup)
52 | .off('move', this._movePopup);
53 | }
54 | return this;
55 | },
56 |
57 | _movePopup: function (e) {
58 | this._popup.setLatLng(e.latlng);
59 | }
60 | });
61 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/tile/TileLayer.Canvas.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.TileLayer.Canvas is a class that you can use as a base for creating
3 | * dynamically drawn Canvas-based tile layers.
4 | */
5 |
6 | L.TileLayer.Canvas = L.TileLayer.extend({
7 | options: {
8 | async: false
9 | },
10 |
11 | initialize: function (options) {
12 | L.setOptions(this, options);
13 | },
14 |
15 | redraw: function () {
16 | var tiles = this._tiles;
17 |
18 | for (var i in tiles) {
19 | if (tiles.hasOwnProperty(i)) {
20 | this._redrawTile(tiles[i]);
21 | }
22 | }
23 | },
24 |
25 | _redrawTile: function (tile) {
26 | this.drawTile(tile, tile._tilePoint, this._map._zoom);
27 | },
28 |
29 | _createTileProto: function () {
30 | var proto = this._canvasProto = L.DomUtil.create('canvas', 'leaflet-tile');
31 | proto.width = proto.height = this.options.tileSize;
32 | },
33 |
34 | _createTile: function () {
35 | var tile = this._canvasProto.cloneNode(false);
36 | tile.onselectstart = tile.onmousemove = L.Util.falseFn;
37 | return tile;
38 | },
39 |
40 | _loadTile: function (tile, tilePoint) {
41 | tile._layer = this;
42 | tile._tilePoint = tilePoint;
43 |
44 | this._redrawTile(tile);
45 |
46 | if (!this.options.async) {
47 | this.tileDrawn(tile);
48 | }
49 | },
50 |
51 | drawTile: function (/*tile, tilePoint*/) {
52 | // override with rendering code
53 | },
54 |
55 | tileDrawn: function (tile) {
56 | this._tileOnLoad.call(tile);
57 | }
58 | });
59 |
60 |
61 | L.tileLayer.canvas = function (options) {
62 | return new L.TileLayer.Canvas(options);
63 | };
64 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/CircleMarker.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.CircleMarker is a circle overlay with a permanent pixel radius.
3 | */
4 |
5 | L.CircleMarker = L.Circle.extend({
6 | options: {
7 | radius: 10,
8 | weight: 2
9 | },
10 |
11 | initialize: function (latlng, options) {
12 | L.Circle.prototype.initialize.call(this, latlng, null, options);
13 | this._radius = this.options.radius;
14 | },
15 |
16 | projectLatlngs: function () {
17 | this._point = this._map.latLngToLayerPoint(this._latlng);
18 | },
19 |
20 | _updateStyle : function () {
21 | L.Circle.prototype._updateStyle.call(this);
22 | this.setRadius(this.options.radius);
23 | },
24 |
25 | setRadius: function (radius) {
26 | this.options.radius = this._radius = radius;
27 | return this.redraw();
28 | }
29 | });
30 |
31 | L.circleMarker = function (latlng, options) {
32 | return new L.CircleMarker(latlng, options);
33 | };
34 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/MultiPoly.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Contains L.MultiPolyline and L.MultiPolygon layers.
3 | */
4 |
5 | (function () {
6 | function createMulti(Klass) {
7 |
8 | return L.FeatureGroup.extend({
9 |
10 | initialize: function (latlngs, options) {
11 | this._layers = {};
12 | this._options = options;
13 | this.setLatLngs(latlngs);
14 | },
15 |
16 | setLatLngs: function (latlngs) {
17 | var i = 0,
18 | len = latlngs.length;
19 |
20 | this.eachLayer(function (layer) {
21 | if (i < len) {
22 | layer.setLatLngs(latlngs[i++]);
23 | } else {
24 | this.removeLayer(layer);
25 | }
26 | }, this);
27 |
28 | while (i < len) {
29 | this.addLayer(new Klass(latlngs[i++], this._options));
30 | }
31 |
32 | return this;
33 | }
34 | });
35 | }
36 |
37 | L.MultiPolyline = createMulti(L.Polyline);
38 | L.MultiPolygon = createMulti(L.Polygon);
39 |
40 | L.multiPolyline = function (latlngs, options) {
41 | return new L.MultiPolyline(latlngs, options);
42 | };
43 |
44 | L.multiPolygon = function (latlngs, options) {
45 | return new L.MultiPolygon(latlngs, options);
46 | };
47 | }());
48 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/Path.Popup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Popup extension to L.Path (polylines, polygons, circles), adding popup-related methods.
3 | */
4 |
5 | L.Path.include({
6 |
7 | bindPopup: function (content, options) {
8 |
9 | if (!this._popup || options) {
10 | this._popup = new L.Popup(options, this);
11 | }
12 |
13 | this._popup.setContent(content);
14 |
15 | if (!this._popupHandlersAdded) {
16 | this
17 | .on('click', this._openPopup, this)
18 | .on('remove', this.closePopup, this);
19 |
20 | this._popupHandlersAdded = true;
21 | }
22 |
23 | return this;
24 | },
25 |
26 | unbindPopup: function () {
27 | if (this._popup) {
28 | this._popup = null;
29 | this
30 | .off('click', this._openPopup)
31 | .off('remove', this.closePopup);
32 |
33 | this._popupHandlersAdded = false;
34 | }
35 | return this;
36 | },
37 |
38 | openPopup: function (latlng) {
39 |
40 | if (this._popup) {
41 | // open the popup from one of the path's points if not specified
42 | latlng = latlng || this._latlng ||
43 | this._latlngs[Math.floor(this._latlngs.length / 2)];
44 |
45 | this._openPopup({latlng: latlng});
46 | }
47 |
48 | return this;
49 | },
50 |
51 | closePopup: function () {
52 | if (this._popup) {
53 | this._popup._close();
54 | }
55 | return this;
56 | },
57 |
58 | _openPopup: function (e) {
59 | this._popup.setLatLng(e.latlng);
60 | this._map.openPopup(this._popup);
61 | }
62 | });
63 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/Polygon.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Polygon is used to display polygons on a map.
3 | */
4 |
5 | L.Polygon = L.Polyline.extend({
6 | options: {
7 | fill: true
8 | },
9 |
10 | initialize: function (latlngs, options) {
11 | L.Polyline.prototype.initialize.call(this, latlngs, options);
12 |
13 | if (latlngs && L.Util.isArray(latlngs[0]) && (typeof latlngs[0][0] !== 'number')) {
14 | this._latlngs = this._convertLatLngs(latlngs[0]);
15 | this._holes = latlngs.slice(1);
16 | }
17 | },
18 |
19 | projectLatlngs: function () {
20 | L.Polyline.prototype.projectLatlngs.call(this);
21 |
22 | // project polygon holes points
23 | // TODO move this logic to Polyline to get rid of duplication
24 | this._holePoints = [];
25 |
26 | if (!this._holes) { return; }
27 |
28 | var i, j, len, len2;
29 |
30 | for (i = 0, len = this._holes.length; i < len; i++) {
31 | this._holePoints[i] = [];
32 |
33 | for (j = 0, len2 = this._holes[i].length; j < len2; j++) {
34 | this._holePoints[i][j] = this._map.latLngToLayerPoint(this._holes[i][j]);
35 | }
36 | }
37 | },
38 |
39 | _clipPoints: function () {
40 | var points = this._originalPoints,
41 | newParts = [];
42 |
43 | this._parts = [points].concat(this._holePoints);
44 |
45 | if (this.options.noClip) { return; }
46 |
47 | for (var i = 0, len = this._parts.length; i < len; i++) {
48 | var clipped = L.PolyUtil.clipPolygon(this._parts[i], this._map._pathViewport);
49 | if (clipped.length) {
50 | newParts.push(clipped);
51 | }
52 | }
53 |
54 | this._parts = newParts;
55 | },
56 |
57 | _getPathPartStr: function (points) {
58 | var str = L.Polyline.prototype._getPathPartStr.call(this, points);
59 | return str + (L.Browser.svg ? 'z' : 'x');
60 | }
61 | });
62 |
63 | L.polygon = function (latlngs, options) {
64 | return new L.Polygon(latlngs, options);
65 | };
66 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/Rectangle.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object.
3 | */
4 |
5 | L.Rectangle = L.Polygon.extend({
6 | initialize: function (latLngBounds, options) {
7 | L.Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options);
8 | },
9 |
10 | setBounds: function (latLngBounds) {
11 | this.setLatLngs(this._boundsToLatLngs(latLngBounds));
12 | },
13 |
14 | _boundsToLatLngs: function (latLngBounds) {
15 | latLngBounds = L.latLngBounds(latLngBounds);
16 | return [
17 | latLngBounds.getSouthWest(),
18 | latLngBounds.getNorthWest(),
19 | latLngBounds.getNorthEast(),
20 | latLngBounds.getSouthEast()
21 | ];
22 | }
23 | });
24 |
25 | L.rectangle = function (latLngBounds, options) {
26 | return new L.Rectangle(latLngBounds, options);
27 | };
28 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/canvas/Circle.Canvas.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Extends L.Circle with Canvas-specific code.
3 | */
4 |
5 | L.Circle.include(!L.Path.CANVAS ? {} : {
6 | _drawPath: function () {
7 | var p = this._point;
8 | this._ctx.beginPath();
9 | this._ctx.arc(p.x, p.y, this._radius, 0, Math.PI * 2, false);
10 | },
11 |
12 | _containsPoint: function (p) {
13 | var center = this._point,
14 | w2 = this.options.stroke ? this.options.weight / 2 : 0;
15 |
16 | return (p.distanceTo(center) <= this._radius + w2);
17 | }
18 | });
19 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/canvas/Polygon.Canvas.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Extends L.Polygon to be able to manually detect clicks on Canvas-rendered polygons.
3 | */
4 |
5 | L.Polygon.include(!L.Path.CANVAS ? {} : {
6 | _containsPoint: function (p) {
7 | var inside = false,
8 | part, p1, p2,
9 | i, j, k,
10 | len, len2;
11 |
12 | // TODO optimization: check if within bounds first
13 |
14 | if (L.Polyline.prototype._containsPoint.call(this, p, true)) {
15 | // click on polygon border
16 | return true;
17 | }
18 |
19 | // ray casting algorithm for detecting if point is in polygon
20 |
21 | for (i = 0, len = this._parts.length; i < len; i++) {
22 | part = this._parts[i];
23 |
24 | for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {
25 | p1 = part[j];
26 | p2 = part[k];
27 |
28 | if (((p1.y > p.y) !== (p2.y > p.y)) &&
29 | (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {
30 | inside = !inside;
31 | }
32 | }
33 | }
34 |
35 | return inside;
36 | }
37 | });
38 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/layer/vector/canvas/Polyline.Canvas.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Extends L.Polyline to be able to manually detect clicks on Canvas-rendered polylines.
3 | */
4 |
5 | L.Polyline.include(!L.Path.CANVAS ? {} : {
6 | _containsPoint: function (p, closed) {
7 | var i, j, k, len, len2, dist, part,
8 | w = this.options.weight / 2;
9 |
10 | if (L.Browser.touch) {
11 | w += 10; // polyline click tolerance on touch devices
12 | }
13 |
14 | for (i = 0, len = this._parts.length; i < len; i++) {
15 | part = this._parts[i];
16 | for (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {
17 | if (!closed && (j === 0)) {
18 | continue;
19 | }
20 |
21 | dist = L.LineUtil.pointToSegmentDistance(p, part[k], part[j]);
22 |
23 | if (dist <= w) {
24 | return true;
25 | }
26 | }
27 | }
28 | return false;
29 | }
30 | });
31 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/map/anim/Map.PanAnimation.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Extends L.Map to handle panning animations.
3 | */
4 |
5 | L.Map.include({
6 |
7 | setView: function (center, zoom, forceReset) {
8 | zoom = this._limitZoom(zoom);
9 |
10 | var zoomChanged = (this._zoom !== zoom);
11 |
12 | if (this._loaded && !forceReset && this._layers) {
13 |
14 | if (this._panAnim) {
15 | this._panAnim.stop();
16 | }
17 |
18 | var done = (zoomChanged ?
19 | this._zoomToIfClose && this._zoomToIfClose(center, zoom) :
20 | this._panByIfClose(center));
21 |
22 | // exit if animated pan or zoom started
23 | if (done) {
24 | clearTimeout(this._sizeTimer);
25 | return this;
26 | }
27 | }
28 |
29 | // reset the map view
30 | this._resetView(center, zoom);
31 |
32 | return this;
33 | },
34 |
35 | panBy: function (offset, duration, easeLinearity) {
36 | offset = L.point(offset);
37 |
38 | if (!(offset.x || offset.y)) {
39 | return this;
40 | }
41 |
42 | if (!this._panAnim) {
43 | this._panAnim = new L.PosAnimation();
44 |
45 | this._panAnim.on({
46 | 'step': this._onPanTransitionStep,
47 | 'end': this._onPanTransitionEnd
48 | }, this);
49 | }
50 |
51 | this.fire('movestart');
52 |
53 | L.DomUtil.addClass(this._mapPane, 'leaflet-pan-anim');
54 |
55 | var newPos = L.DomUtil.getPosition(this._mapPane).subtract(offset)._round();
56 | this._panAnim.run(this._mapPane, newPos, duration || 0.25, easeLinearity);
57 |
58 | return this;
59 | },
60 |
61 | _onPanTransitionStep: function () {
62 | this.fire('move');
63 | },
64 |
65 | _onPanTransitionEnd: function () {
66 | L.DomUtil.removeClass(this._mapPane, 'leaflet-pan-anim');
67 | this.fire('moveend');
68 | },
69 |
70 | _panByIfClose: function (center) {
71 | // difference between the new and current centers in pixels
72 | var offset = this._getCenterOffset(center)._floor();
73 |
74 | if (this._offsetIsWithinView(offset)) {
75 | this.panBy(offset);
76 | return true;
77 | }
78 | return false;
79 | },
80 |
81 | _offsetIsWithinView: function (offset, multiplyFactor) {
82 | var m = multiplyFactor || 1,
83 | size = this.getSize();
84 |
85 | return (Math.abs(offset.x) <= size.x * m) &&
86 | (Math.abs(offset.y) <= size.y * m);
87 | }
88 | });
89 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/map/ext/Map.Control.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Adds control-related methods to L.Map.
3 | */
4 |
5 | L.Map.include({
6 | addControl: function (control) {
7 | control.addTo(this);
8 | return this;
9 | },
10 |
11 | removeControl: function (control) {
12 | control.removeFrom(this);
13 | return this;
14 | },
15 |
16 | _initControlPos: function () {
17 | var corners = this._controlCorners = {},
18 | l = 'leaflet-',
19 | container = this._controlContainer =
20 | L.DomUtil.create('div', l + 'control-container', this._container);
21 |
22 | function createCorner(vSide, hSide) {
23 | var className = l + vSide + ' ' + l + hSide;
24 |
25 | corners[vSide + hSide] = L.DomUtil.create('div', className, container);
26 | }
27 |
28 | createCorner('top', 'left');
29 | createCorner('top', 'right');
30 | createCorner('bottom', 'left');
31 | createCorner('bottom', 'right');
32 | }
33 | });
34 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/map/ext/Map.Popup.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Adds popup-related methods to L.Map.
3 | */
4 |
5 | L.Map.include({
6 | openPopup: function (popup) {
7 | this.closePopup();
8 |
9 | this._popup = popup;
10 |
11 | return this
12 | .addLayer(popup)
13 | .fire('popupopen', {popup: this._popup});
14 | },
15 |
16 | closePopup: function () {
17 | if (this._popup) {
18 | this._popup._close();
19 | }
20 | return this;
21 | }
22 | });
23 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/map/handler/Map.DoubleClickZoom.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default.
3 | */
4 |
5 | L.Map.mergeOptions({
6 | doubleClickZoom: true
7 | });
8 |
9 | L.Map.DoubleClickZoom = L.Handler.extend({
10 | addHooks: function () {
11 | this._map.on('dblclick', this._onDoubleClick);
12 | },
13 |
14 | removeHooks: function () {
15 | this._map.off('dblclick', this._onDoubleClick);
16 | },
17 |
18 | _onDoubleClick: function (e) {
19 | this.setView(e.latlng, this._zoom + 1);
20 | }
21 | });
22 |
23 | L.Map.addInitHook('addHandler', 'doubleClickZoom', L.Map.DoubleClickZoom);
24 |
--------------------------------------------------------------------------------
/public/vendor/leaflet/src/map/handler/Map.ScrollWheelZoom.js:
--------------------------------------------------------------------------------
1 | /*
2 | * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map.
3 | */
4 |
5 | L.Map.mergeOptions({
6 | scrollWheelZoom: true
7 | });
8 |
9 | L.Map.ScrollWheelZoom = L.Handler.extend({
10 | addHooks: function () {
11 | L.DomEvent.on(this._map._container, 'mousewheel', this._onWheelScroll, this);
12 | this._delta = 0;
13 | },
14 |
15 | removeHooks: function () {
16 | L.DomEvent.off(this._map._container, 'mousewheel', this._onWheelScroll);
17 | },
18 |
19 | _onWheelScroll: function (e) {
20 | var delta = L.DomEvent.getWheelDelta(e);
21 |
22 | this._delta += delta;
23 | this._lastMousePos = this._map.mouseEventToContainerPoint(e);
24 |
25 | if (!this._startTime) {
26 | this._startTime = +new Date();
27 | }
28 |
29 | var left = Math.max(40 - (+new Date() - this._startTime), 0);
30 |
31 | clearTimeout(this._timer);
32 | this._timer = setTimeout(L.bind(this._performZoom, this), left);
33 |
34 | L.DomEvent.preventDefault(e);
35 | L.DomEvent.stopPropagation(e);
36 | },
37 |
38 | _performZoom: function () {
39 | var map = this._map,
40 | delta = this._delta,
41 | zoom = map.getZoom();
42 |
43 | delta = delta > 0 ? Math.ceil(delta) : Math.round(delta);
44 | delta = Math.max(Math.min(delta, 4), -4);
45 | delta = map._limitZoom(zoom + delta) - zoom;
46 |
47 | this._delta = 0;
48 |
49 | this._startTime = null;
50 |
51 | if (!delta) { return; }
52 |
53 | var newZoom = zoom + delta,
54 | newCenter = this._getCenterForScrollWheelZoom(newZoom);
55 |
56 | map.setView(newCenter, newZoom);
57 | },
58 |
59 | _getCenterForScrollWheelZoom: function (newZoom) {
60 | var map = this._map,
61 | scale = map.getZoomScale(newZoom),
62 | viewHalf = map.getSize()._divideBy(2),
63 | centerOffset = this._lastMousePos._subtract(viewHalf)._multiplyBy(1 - 1 / scale),
64 | newCenterPoint = map._getTopLeftPoint()._add(viewHalf)._add(centerOffset);
65 |
66 | return map.unproject(newCenterPoint);
67 | }
68 | });
69 |
70 | L.Map.addInitHook('addHandler', 'scrollWheelZoom', L.Map.ScrollWheelZoom);
71 |
--------------------------------------------------------------------------------
/public/vendor/underscore/.gitignore:
--------------------------------------------------------------------------------
1 | raw
2 | node_modules
3 |
--------------------------------------------------------------------------------
/public/vendor/underscore/.npmignore:
--------------------------------------------------------------------------------
1 | test/
2 | Rakefile
3 | docs/
4 | raw/
5 |
--------------------------------------------------------------------------------
/public/vendor/underscore/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.8
4 | notifications:
5 | email: false
6 |
--------------------------------------------------------------------------------
/public/vendor/underscore/CNAME:
--------------------------------------------------------------------------------
1 | underscorejs.org
2 |
--------------------------------------------------------------------------------
/public/vendor/underscore/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## How to contribute to Underscore.js
2 |
3 | * Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
4 |
5 | * Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/).
6 |
7 | * Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js).
8 |
9 | * In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release.
10 |
--------------------------------------------------------------------------------
/public/vendor/underscore/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/public/vendor/underscore/README.md:
--------------------------------------------------------------------------------
1 | __
2 | /\ \ __
3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____
4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\
5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\
6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/
7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/
8 | \ \____/
9 | \/___/
10 |
11 | Underscore.js is a utility-belt library for JavaScript that provides
12 | support for the usual functional suspects (each, map, reduce, filter...)
13 | without extending any core JavaScript objects.
14 |
15 | For Docs, License, Tests, and pre-packed downloads, see:
16 | http://underscorejs.org
17 |
18 | Many thanks to our contributors:
19 | https://github.com/documentcloud/underscore/contributors
20 |
--------------------------------------------------------------------------------
/public/vendor/underscore/Rakefile:
--------------------------------------------------------------------------------
1 | desc "Use Uglify JS to compress Underscore.js"
2 | task :build do
3 | sh "uglifyjs underscore.js -c \"evaluate=false\" -m -o underscore-min.js"
4 | end
5 |
6 | desc "Build the docco documentation"
7 | task :doc do
8 | sh "docco underscore.js"
9 | end
10 |
11 |
--------------------------------------------------------------------------------
/public/vendor/underscore/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "underscore",
3 | "version": "1.4.4",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/documentcloud/underscore.git"
7 | }
8 | }
--------------------------------------------------------------------------------
/public/vendor/underscore/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/underscore/docs/favicon.ico
--------------------------------------------------------------------------------
/public/vendor/underscore/docs/images/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/underscore/docs/images/background.png
--------------------------------------------------------------------------------
/public/vendor/underscore/docs/images/underscore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/underscore/docs/images/underscore.png
--------------------------------------------------------------------------------
/public/vendor/underscore/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hoodiehq/hoodie-app-mapchat/96792cd7ece1a21c385eb4e8e26f2583f860014d/public/vendor/underscore/favicon.ico
--------------------------------------------------------------------------------
/public/vendor/underscore/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./underscore');
2 |
--------------------------------------------------------------------------------
/public/vendor/underscore/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "underscore",
3 | "description" : "JavaScript's functional programming helper library.",
4 | "homepage" : "http://underscorejs.org",
5 | "keywords" : ["util", "functional", "server", "client", "browser"],
6 | "author" : "Jeremy Ashkenas ",
7 | "repository" : {"type": "git", "url": "git://github.com/documentcloud/underscore.git"},
8 | "main" : "underscore.js",
9 | "version" : "1.4.4",
10 | "devDependencies": {
11 | "phantomjs": "0.2.2"
12 | },
13 | "scripts": {
14 | "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/public/vendor/underscore/test/chaining.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 |
3 | module("Chaining");
4 |
5 | test("map/flatten/reduce", function() {
6 | var lyrics = [
7 | "I'm a lumberjack and I'm okay",
8 | "I sleep all night and I work all day",
9 | "He's a lumberjack and he's okay",
10 | "He sleeps all night and he works all day"
11 | ];
12 | var counts = _(lyrics).chain()
13 | .map(function(line) { return line.split(''); })
14 | .flatten()
15 | .reduce(function(hash, l) {
16 | hash[l] = hash[l] || 0;
17 | hash[l]++;
18 | return hash;
19 | }, {}).value();
20 | ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song');
21 | });
22 |
23 | test("select/reject/sortBy", function() {
24 | var numbers = [1,2,3,4,5,6,7,8,9,10];
25 | numbers = _(numbers).chain().select(function(n) {
26 | return n % 2 == 0;
27 | }).reject(function(n) {
28 | return n % 4 == 0;
29 | }).sortBy(function(n) {
30 | return -n;
31 | }).value();
32 | equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers");
33 | });
34 |
35 | test("select/reject/sortBy in functional style", function() {
36 | var numbers = [1,2,3,4,5,6,7,8,9,10];
37 | numbers = _.chain(numbers).select(function(n) {
38 | return n % 2 == 0;
39 | }).reject(function(n) {
40 | return n % 4 == 0;
41 | }).sortBy(function(n) {
42 | return -n;
43 | }).value();
44 | equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers");
45 | });
46 |
47 | test("reverse/concat/unshift/pop/map", function() {
48 | var numbers = [1,2,3,4,5];
49 | numbers = _(numbers).chain()
50 | .reverse()
51 | .concat([5, 5, 5])
52 | .unshift(17)
53 | .pop()
54 | .map(function(n){ return n * 2; })
55 | .value();
56 | equal(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.');
57 | });
58 |
59 | });
60 |
--------------------------------------------------------------------------------
/public/vendor/underscore/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Underscore Test Suite
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
Underscore Speed Suite
29 |
30 | A representative sample of the functions are benchmarked here, to provide
31 | a sense of how fast they might run in different browsers.
32 | Each iteration runs on an array of 1000 elements.
33 | For example, the 'intersection' test measures the number of times you can
34 | find the intersection of two thousand-element arrays in one second.
35 |