├── .gitignore
├── theme
└── default
│ ├── framedCloud.css
│ ├── img
│ ├── blank.gif
│ ├── close.gif
│ ├── pan_on.png
│ ├── ruler.png
│ ├── pan_off.png
│ ├── pan-panel.png
│ ├── zoom-panel.png
│ ├── add_point_off.png
│ ├── add_point_on.png
│ ├── draw_line_off.png
│ ├── draw_line_on.png
│ ├── draw_point_on.png
│ ├── view_next_off.png
│ ├── view_next_on.png
│ ├── draw_point_off.png
│ ├── draw_polygon_off.png
│ ├── draw_polygon_on.png
│ ├── editing_tool_bar.png
│ ├── move_feature_off.png
│ ├── move_feature_on.png
│ ├── panning-hand-off.png
│ ├── panning-hand-on.png
│ ├── remove_point_off.png
│ ├── remove_point_on.png
│ ├── save_features_on.png
│ ├── view_previous_on.png
│ ├── drag-rectangle-off.png
│ ├── drag-rectangle-on.png
│ ├── navigation_history.png
│ ├── pan-panel-NOALPHA.png
│ ├── save_features_off.png
│ ├── view_previous_off.png
│ ├── zoom-panel-NOALPHA.png
│ └── overview_replacement.gif
│ ├── ie6-style.tidy.css
│ ├── google.tidy.css
│ ├── ie6-style.css
│ ├── google.css
│ ├── style.tidy.css
│ └── style.css
├── gpxanim.html
├── README.md
├── style.css
├── OpenStreetMap.js
├── style.scss
├── gpxanim.py
├── gpxanim.js
└── jquery-1.7.2.min.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .sass-cache
2 |
--------------------------------------------------------------------------------
/theme/default/framedCloud.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/theme/default/img/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/blank.gif
--------------------------------------------------------------------------------
/theme/default/img/close.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/close.gif
--------------------------------------------------------------------------------
/theme/default/img/pan_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/pan_on.png
--------------------------------------------------------------------------------
/theme/default/img/ruler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/ruler.png
--------------------------------------------------------------------------------
/theme/default/img/pan_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/pan_off.png
--------------------------------------------------------------------------------
/theme/default/img/pan-panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/pan-panel.png
--------------------------------------------------------------------------------
/theme/default/img/zoom-panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/zoom-panel.png
--------------------------------------------------------------------------------
/theme/default/img/add_point_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/add_point_off.png
--------------------------------------------------------------------------------
/theme/default/img/add_point_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/add_point_on.png
--------------------------------------------------------------------------------
/theme/default/img/draw_line_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/draw_line_off.png
--------------------------------------------------------------------------------
/theme/default/img/draw_line_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/draw_line_on.png
--------------------------------------------------------------------------------
/theme/default/img/draw_point_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/draw_point_on.png
--------------------------------------------------------------------------------
/theme/default/img/view_next_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/view_next_off.png
--------------------------------------------------------------------------------
/theme/default/img/view_next_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/view_next_on.png
--------------------------------------------------------------------------------
/theme/default/img/draw_point_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/draw_point_off.png
--------------------------------------------------------------------------------
/theme/default/img/draw_polygon_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/draw_polygon_off.png
--------------------------------------------------------------------------------
/theme/default/img/draw_polygon_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/draw_polygon_on.png
--------------------------------------------------------------------------------
/theme/default/img/editing_tool_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/editing_tool_bar.png
--------------------------------------------------------------------------------
/theme/default/img/move_feature_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/move_feature_off.png
--------------------------------------------------------------------------------
/theme/default/img/move_feature_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/move_feature_on.png
--------------------------------------------------------------------------------
/theme/default/img/panning-hand-off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/panning-hand-off.png
--------------------------------------------------------------------------------
/theme/default/img/panning-hand-on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/panning-hand-on.png
--------------------------------------------------------------------------------
/theme/default/img/remove_point_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/remove_point_off.png
--------------------------------------------------------------------------------
/theme/default/img/remove_point_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/remove_point_on.png
--------------------------------------------------------------------------------
/theme/default/img/save_features_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/save_features_on.png
--------------------------------------------------------------------------------
/theme/default/img/view_previous_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/view_previous_on.png
--------------------------------------------------------------------------------
/theme/default/img/drag-rectangle-off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/drag-rectangle-off.png
--------------------------------------------------------------------------------
/theme/default/img/drag-rectangle-on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/drag-rectangle-on.png
--------------------------------------------------------------------------------
/theme/default/img/navigation_history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/navigation_history.png
--------------------------------------------------------------------------------
/theme/default/img/pan-panel-NOALPHA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/pan-panel-NOALPHA.png
--------------------------------------------------------------------------------
/theme/default/img/save_features_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/save_features_off.png
--------------------------------------------------------------------------------
/theme/default/img/view_previous_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/view_previous_off.png
--------------------------------------------------------------------------------
/theme/default/img/zoom-panel-NOALPHA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/zoom-panel-NOALPHA.png
--------------------------------------------------------------------------------
/theme/default/img/overview_replacement.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rvl/gpxanim/HEAD/theme/default/img/overview_replacement.gif
--------------------------------------------------------------------------------
/theme/default/ie6-style.tidy.css:
--------------------------------------------------------------------------------
1 | .olControlZoomPanel div{background-image:url(img/zoom-panel-NOALPHA.png);}.olControlPanPanel div{background-image:url(img/pan-panel-NOALPHA.png);}.olControlEditingToolbar{width:200px;}
--------------------------------------------------------------------------------
/theme/default/google.tidy.css:
--------------------------------------------------------------------------------
1 | .olLayerGoogleCopyright{right:3px;bottom:2px;left:auto;}.olLayerGoogleV3.olLayerGoogleCopyright{bottom:0;right:0!important;}.olLayerGooglePoweredBy{left:2px;bottom:2px;}.olLayerGoogleV3.olLayerGooglePoweredBy{bottom:0!important;}
--------------------------------------------------------------------------------
/theme/default/ie6-style.css:
--------------------------------------------------------------------------------
1 | .olControlZoomPanel div {
2 | background-image: url(img/zoom-panel-NOALPHA.png);
3 | }
4 | .olControlPanPanel div {
5 | background-image: url(img/pan-panel-NOALPHA.png);
6 | }
7 | .olControlEditingToolbar {
8 | width: 200px;
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/theme/default/google.css:
--------------------------------------------------------------------------------
1 | .olLayerGoogleCopyright {
2 | right: 3px;
3 | bottom: 2px;
4 | left: auto;
5 | }
6 | .olLayerGoogleV3.olLayerGoogleCopyright {
7 | bottom: 0px;
8 | right: 0px !important;
9 | }
10 | .olLayerGooglePoweredBy {
11 | left: 2px;
12 | bottom: 2px;
13 | }
14 | .olLayerGoogleV3.olLayerGooglePoweredBy {
15 | bottom: 0px !important;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/gpxanim.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Map tracker
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
25 |
26 |
27 | Map tracker
28 |
29 |
32 |
33 | Speed:
34 |
35 | #
36 | ms
37 |
38 |
39 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | gpxanim
2 | =======
3 |
4 | `gpxanim` creates animated maps from GPX tracks.
5 |
6 | It will plot the track as a line and rotate the map so that the
7 | direction of travel is always "up".
8 |
9 | The track is interpolated to achieve smooth animation.
10 |
11 | Here is an example of its output: http://youtu.be/7-tOJGSVWkc
12 |
13 |
14 | How it works
15 | ------------
16 |
17 | 1. There are two components of `gpxanim`: a python script which
18 | controls the process, and a javascript module which updates the
19 | animation each frame.
20 |
21 | 2. `gpxanim` uses the [OpenLayers][] javascript library to render the
22 | map tiles and GPX track.
23 |
24 | 3. [WebKitGTK][] runs a small web page containing the map widget.
25 |
26 | 4. Every frame, a screenshot is captured of the map and fed into a
27 | [GStreamer][] pipeline which creates an [Ogg Theora][] video file.
28 |
29 | [OpenLayers]: http://www.openlayers.org/
30 | [WebKitGTK]: http://webkitgtk.org/
31 | [GStreamer]: http://gstreamer.freedesktop.org/
32 | [Ogg Theora]: http://www.theora.org/
33 |
34 | How to use
35 | ----------
36 |
37 | First, get your track in GPX format. It would be better to have
38 | correct speed and course values for the trackpoints. You can use
39 | [GPSBabel][] to calculate the values:
40 |
41 | gpsbabel -i gpx -f bikehike.gpx \
42 | -x track,course -x track,speed \
43 | -o gpx -F synth.gpx
44 |
45 | Then run
46 |
47 | python gpxanim.py synth.gpx
48 |
49 | and it will start animating. It's not very fast unfortunately. At the
50 | end you will have a video, called `synth.ogg` by default.
51 |
52 | To see the full list of options, run
53 |
54 | python gpxanim.py --help
55 |
56 | [GPSBabel]: http://www.gpsbabel.org/
57 |
58 |
59 | Required packages (Debian/Ubuntu)
60 | ---------------------------------
61 |
62 | apt-get install python python-gtk2 python-webkit python-gst0.10 gstreamer0.10-ffmpeg gpsbabel gpsbabel-doc
63 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS Reset
3 | * From Blueprint reset.css
4 | * http://blueprintcss.googlecode.com
5 | */
6 | html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
7 | margin: 0;
8 | padding: 0;
9 | border: 0;
10 | font-weight: inherit;
11 | font-style: inherit;
12 | font-size: 100%;
13 | font-family: inherit;
14 | vertical-align: baseline; }
15 |
16 | body {
17 | line-height: 1.5; }
18 |
19 | table {
20 | border-collapse: separate;
21 | border-spacing: 0; }
22 |
23 | caption, th, td {
24 | text-align: left;
25 | font-weight: normal; }
26 |
27 | table, td, th {
28 | vertical-align: middle; }
29 |
30 | blockquote:before, blockquote:after {
31 | content: ""; }
32 |
33 | q:before, q:after {
34 | content: ""; }
35 |
36 | blockquote, q {
37 | quotes: "" ""; }
38 |
39 | a img {
40 | border: none; }
41 |
42 | /**
43 | * Basic Typography
44 | */
45 | body {
46 | font-family: "Lucida Grande", Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
47 | font-size: 80%;
48 | color: #222;
49 | background: #fff;
50 | margin: 1em 1.5em; }
51 |
52 | pre, code {
53 | margin: 1.5em 0;
54 | white-space: pre; }
55 |
56 | pre, code {
57 | font: 1em 'andale mono', 'lucida console', monospace;
58 | line-height: 1.5; }
59 |
60 | a[href] {
61 | color: #436976;
62 | background-color: transparent; }
63 |
64 | h1, h2, h3, h4, h5, h6 {
65 | color: #003a6b;
66 | background-color: transparent;
67 | font: 100% "Lucida Grande", Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
68 | margin: 0;
69 | padding-top: 0.5em; }
70 |
71 | h1 {
72 | font-size: 130%;
73 | margin-bottom: 0.5em;
74 | border-bottom: 1px solid #fcb100; }
75 |
76 | h2 {
77 | font-size: 120%;
78 | margin-bottom: 0.5em;
79 | border-bottom: 1px solid #aaa; }
80 |
81 | h3 {
82 | font-size: 110%;
83 | margin-bottom: 0.5em;
84 | text-decoration: underline; }
85 |
86 | h4, h5 {
87 | font-size: 100%;
88 | font-weight: bold; }
89 |
90 | h6 {
91 | font-size: 80%;
92 | font-weight: bold; }
93 |
94 | /**
95 | * Map Examples Specific
96 | */
97 | .smallmap {
98 | width: 512px;
99 | height: 256px;
100 | border: 1px solid #ccc; }
101 |
102 | #tags {
103 | display: none; }
104 |
105 | #docs p {
106 | margin-bottom: 0.5em; }
107 |
108 | /* mobile specific */
109 | @media only screen and (max-width: 600px) {
110 | body {
111 | height: 100%;
112 | margin: 0;
113 | padding: 0;
114 | width: 100%; }
115 |
116 | #map {
117 | background: #7391ad;
118 | width: 100%;
119 | border: 0;
120 | height: 250px; }
121 |
122 | #title {
123 | font-size: 1.3em;
124 | line-height: 2em;
125 | text-indent: 1em;
126 | margin: 0;
127 | padding: 0; }
128 |
129 | #docs {
130 | bottom: 0;
131 | padding: 1em; }
132 |
133 | #shortdesc {
134 | color: #aaa;
135 | font-size: 0.8em;
136 | padding: 1em;
137 | text-align: right; }
138 |
139 | #tags {
140 | display: none; } }
141 | @media only screen and (orientation: landscape) and (max-width: 600px) {
142 | #shortdesc {
143 | float: right;
144 | width: 25%; }
145 |
146 | #map {
147 | width: 70%; }
148 |
149 | #docs {
150 | font-size: 12px; } }
151 | body {
152 | -webkit-text-size-adjust: none; }
153 | body.embed {
154 | margin: 0px;
155 | padding: 0px; }
156 |
157 | .clipper {
158 | border: 2px solid black;
159 | width: 640px;
160 | height: 360px;
161 | overflow: hidden; }
162 | .clipper.embed {
163 | border: 0; }
164 |
165 | #counter {
166 | text-align: right;
167 | font-family: monospace;
168 | padding: 0em 0.5em;
169 | width: 20em; }
170 |
171 | .rotated {
172 | width: 735px;
173 | height: 735px;
174 | position: relative;
175 | top: -187.5px;
176 | left: -47.5px;
177 | -webkit-backface-visibility: hidden;
178 | /* transform: rotate(7deg); */
179 | /* -ms-transform: rotate(7deg); */
180 | /* /\* IE 9 *\/ */
181 | /* -moz-transform: rotate(7deg); */
182 | /* /\* Firefox *\/ */
183 | /* -webkit-transform: rotate(7deg); */
184 | /* /\* Safari and Chrome *\/ */
185 | /* -o-transform: rotate(7deg); */
186 | /* /\* Opera *\/ */ }
187 |
--------------------------------------------------------------------------------
/OpenStreetMap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Namespace: Util.OSM
3 | */
4 | OpenLayers.Util.OSM = {};
5 |
6 | /**
7 | * Constant: MISSING_TILE_URL
8 | * {String} URL of image to display for missing tiles
9 | */
10 | OpenLayers.Util.OSM.MISSING_TILE_URL = OpenLayers.Util.getImagesLocation() + "404.png";
11 |
12 | /**
13 | * Property: originalOnImageLoadError
14 | * {Function} Original onImageLoadError function.
15 | */
16 | OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
17 |
18 | /**
19 | * Function: onImageLoadError
20 | */
21 | OpenLayers.Util.onImageLoadError = function() {
22 | if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
23 | this.src = OpenLayers.Util.OSM.MISSING_TILE_URL;
24 | } else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) {
25 | // do nothing - this layer is transparent
26 | } else {
27 | OpenLayers.Util.OSM.originalOnImageLoadError;
28 | }
29 | };
30 |
31 | /**
32 | * Class: OpenLayers.Layer.OSM.Mapnik
33 | *
34 | * Inherits from:
35 | * -
36 | */
37 | OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
38 | /**
39 | * Constructor: OpenLayers.Layer.OSM.Mapnik
40 | *
41 | * Parameters:
42 | * name - {String}
43 | * options - {Object} Hashtable of extra options to tag onto the layer
44 | */
45 | initialize: function(name, options) {
46 | var url = [
47 | "http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
48 | "http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
49 | "http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
50 | ];
51 | options = OpenLayers.Util.extend({
52 | numZoomLevels: 19,
53 | buffer: 0,
54 | transitionEffect: "resize"
55 | }, options);
56 | var newArguments = [name, url, options];
57 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
58 | },
59 |
60 | CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
61 | });
62 |
63 | /**
64 | * Class: OpenLayers.Layer.OSM.CycleMap
65 | *
66 | * Inherits from:
67 | * -
68 | */
69 | OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
70 | /**
71 | * Constructor: OpenLayers.Layer.OSM.CycleMap
72 | *
73 | * Parameters:
74 | * name - {String}
75 | * options - {Object} Hashtable of extra options to tag onto the layer
76 | */
77 | initialize: function(name, options) {
78 | var url = [
79 | "http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
80 | "http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
81 | "http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
82 | ];
83 | options = OpenLayers.Util.extend({
84 | numZoomLevels: 19,
85 | buffer: 0,
86 | transitionEffect: "resize"
87 | }, options);
88 | var newArguments = [name, url, options];
89 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
90 | },
91 |
92 | CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
93 | });
94 |
95 | /**
96 | * Class: OpenLayers.Layer.OSM.TransportMap
97 | *
98 | * Inherits from:
99 | * -
100 | */
101 | OpenLayers.Layer.OSM.TransportMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
102 | /**
103 | * Constructor: OpenLayers.Layer.OSM.TransportMap
104 | *
105 | * Parameters:
106 | * name - {String}
107 | * options - {Object} Hashtable of extra options to tag onto the layer
108 | */
109 | initialize: function(name, options) {
110 | var url = [
111 | "http://a.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
112 | "http://b.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png",
113 | "http://c.tile2.opencyclemap.org/transport/${z}/${x}/${y}.png"
114 | ];
115 | options = OpenLayers.Util.extend({
116 | numZoomLevels: 19,
117 | buffer: 0,
118 | transitionEffect: "resize"
119 | }, options);
120 | var newArguments = [name, url, options];
121 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
122 | },
123 |
124 | CLASS_NAME: "OpenLayers.Layer.OSM.TransportMap"
125 | });
126 |
--------------------------------------------------------------------------------
/style.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS Reset
3 | * From Blueprint reset.css
4 | * http://blueprintcss.googlecode.com
5 | */
6 |
7 | html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
8 | margin: 0;
9 | padding: 0;
10 | border: 0;
11 | font-weight: inherit;
12 | font-style: inherit;
13 | font-size: 100%;
14 | font-family: inherit;
15 | vertical-align: baseline; }
16 |
17 | body {
18 | line-height: 1.5; }
19 |
20 | table {
21 | border-collapse: separate;
22 | border-spacing: 0; }
23 |
24 | caption, th, td {
25 | text-align: left;
26 | font-weight: normal; }
27 |
28 | table, td, th {
29 | vertical-align: middle; }
30 |
31 | blockquote {
32 | &:before, &:after {
33 | content: ""; } }
34 |
35 | q {
36 | &:before, &:after {
37 | content: ""; } }
38 |
39 | blockquote, q {
40 | quotes: "" ""; }
41 |
42 | a img {
43 | border: none; }
44 |
45 | /**
46 | * Basic Typography
47 | */
48 |
49 | body {
50 | font-family: "Lucida Grande", Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
51 | font-size: 80%;
52 | color: #222;
53 | background: #fff;
54 | margin: 1em 1.5em; }
55 |
56 | pre, code {
57 | margin: 1.5em 0;
58 | white-space: pre; }
59 |
60 | pre, code {
61 | font: 1em 'andale mono', 'lucida console', monospace;
62 | line-height: 1.5; }
63 |
64 | a[href] {
65 | color: #436976;
66 | background-color: transparent; }
67 |
68 | h1, h2, h3, h4, h5, h6 {
69 | color: #003a6b;
70 | background-color: transparent;
71 | font: 100% "Lucida Grande", Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
72 | margin: 0;
73 | padding-top: 0.5em; }
74 |
75 | h1 {
76 | font-size: 130%;
77 | margin-bottom: 0.5em;
78 | border-bottom: 1px solid #fcb100; }
79 |
80 | h2 {
81 | font-size: 120%;
82 | margin-bottom: 0.5em;
83 | border-bottom: 1px solid #aaa; }
84 |
85 | h3 {
86 | font-size: 110%;
87 | margin-bottom: 0.5em;
88 | text-decoration: underline; }
89 |
90 | h4, h5 {
91 | font-size: 100%;
92 | font-weight: bold; }
93 |
94 | h6 {
95 | font-size: 80%;
96 | font-weight: bold; }
97 |
98 | /**
99 | * Map Examples Specific
100 | */
101 |
102 | .smallmap {
103 | width: 512px;
104 | height: 256px;
105 | border: 1px solid #ccc; }
106 |
107 | #tags {
108 | display: none; }
109 |
110 | #docs p {
111 | margin-bottom: 0.5em; }
112 |
113 | /* mobile specific */
114 | @media only screen and (max-width: 600px) {
115 | body {
116 | height: 100%;
117 | margin: 0;
118 | padding: 0;
119 | width: 100%; }
120 | #map {
121 | background: #7391ad;
122 | width: 100%;
123 | border: 0;
124 | height: 250px; }
125 | #title {
126 | font-size: 1.3em;
127 | line-height: 2em;
128 | text-indent: 1em;
129 | margin: 0;
130 | padding: 0; }
131 | #docs {
132 | bottom: 0;
133 | padding: 1em; }
134 | #shortdesc {
135 | color: #aaa;
136 | font-size: 0.8em;
137 | padding: 1em;
138 | text-align: right; }
139 | #tags {
140 | display: none; } }
141 |
142 | @media only screen and (orientation: landscape) and (max-width: 600px) {
143 | #shortdesc {
144 | float: right;
145 | width: 25%; }
146 | #map {
147 | width: 70%; }
148 | #docs {
149 | font-size: 12px; } }
150 |
151 | body {
152 | -webkit-text-size-adjust: none;
153 |
154 | &.embed {
155 | margin: 0px;
156 | padding: 0px;
157 | //border: 1px solid blue;
158 | }
159 | }
160 |
161 |
162 | $boxw: 640;
163 | $boxh: 360;
164 | $box-width: #{$boxw}px;
165 | $box-height: #{$boxh}px;
166 | //$rotated-size: #{sqrt($boxw * $boxw + $boxh * $boxh)}px;
167 | $rotated-size: 735px;
168 |
169 | .clipper {
170 | border: 2px solid black;
171 | width: $box-width;
172 | height: $box-height;
173 | overflow: hidden;
174 |
175 | &.embed {
176 | border: 0;
177 | }
178 | }
179 |
180 | #counter {
181 | text-align: right;
182 | font-family: monospace;
183 | padding: 0em 0.5em;
184 | width: 20em;
185 | }
186 |
187 | .rotated {
188 | //border: 1px solid green;
189 | width: $rotated-size;
190 | height: $rotated-size;
191 | position: relative;
192 | //top: (($box-height - $rotated-size)/2);
193 | top: -187.5px;
194 | left: -47.5px;
195 |
196 | // http://stackoverflow.com/a/7581301/405240
197 | -webkit-backface-visibility: hidden;
198 |
199 | /* transform: rotate(7deg); */
200 | /* -ms-transform: rotate(7deg); */
201 | /* /\* IE 9 *\/ */
202 | /* -moz-transform: rotate(7deg); */
203 | /* /\* Firefox *\/ */
204 | /* -webkit-transform: rotate(7deg); */
205 | /* /\* Safari and Chrome *\/ */
206 | /* -o-transform: rotate(7deg); */
207 | /* /\* Opera *\/ */
208 | }
209 |
--------------------------------------------------------------------------------
/theme/default/style.tidy.css:
--------------------------------------------------------------------------------
1 | div.olMap{z-index:0;cursor:default;margin:0!important;padding:0!important;}div.olMapViewport{text-align:left;}.olLayerGoogleCopyright{left:2px;bottom:2px;}.olLayerGoogleV3.olLayerGoogleCopyright{right:auto!important;}.olLayerGooglePoweredBy{left:2px;bottom:15px;}.olLayerGoogleV3.olLayerGooglePoweredBy{bottom:15px!important;}.olControlAttribution{font-size:smaller;right:3px;bottom:4.5em;position:absolute;display:block;}.olControlScale{right:3px;bottom:3em;display:block;position:absolute;font-size:smaller;}.olControlScaleLine{display:block;position:absolute;left:10px;bottom:15px;font-size:xx-small;}.olControlScaleLineBottom{border:solid 2px #000;border-bottom:none;margin-top:-2px;text-align:center;}.olControlScaleLineTop{border:solid 2px #000;border-top:none;text-align:center;}.olControlPermalink{right:3px;bottom:1.5em;display:block;position:absolute;font-size:smaller;}div.olControlMousePosition{bottom:0;right:3px;display:block;position:absolute;font-family:Arial;font-size:smaller;}.olControlOverviewMapContainer{position:absolute;bottom:0;right:0;}.olControlOverviewMapElement{background-color:#00008B;-moz-border-radius:1em 0 0;padding:10px 18px 10px 10px;}.olControlOverviewMapExtentRectangle{overflow:hidden;background-image:url(img/blank.gif);cursor:move;border:2px dotted red;}.olControlOverviewMapRectReplacement{overflow:hidden;cursor:move;background-image:url(img/overview_replacement.gif);background-repeat:no-repeat;background-position:center;}.olLayerGeoRSSDescription{float:left;width:100%;overflow:auto;font-size:1em;}.olLayerGeoRSSClose{float:right;color:gray;font-size:1.2em;margin-right:6px;font-family:sans-serif;}.olLayerGeoRSSTitle{float:left;font-size:1.2em;}.olControlNavigationHistory{background-image:url(img/navigation_history.png);background-repeat:no-repeat;width:24px;height:24px;}.olControlNavigationHistoryPreviousItemActive{background-position:0 0;}.olControlNavigationHistoryPreviousItemInactive{background-position:0 -24px;}.olControlNavigationHistoryNextItemActive{background-position:-24px 0;}.olControlNavigationHistoryNextItemInactive{background-position:-24px -24px;}div.olControlSaveFeaturesItemActive{background-image:url(img/save_features_on.png);background-repeat:no-repeat;background-position:0 1px;}div.olControlSaveFeaturesItemInactive{background-image:url(img/save_features_off.png);background-repeat:no-repeat;background-position:0 1px;}.olHandlerBoxZoomBox{border:2px solid red;position:absolute;background-color:#FFF;opacity:.5;font-size:1px;filter:alpha(opacity=50);}.olHandlerBoxSelectFeature{border:2px solid blue;position:absolute;background-color:#FFF;opacity:.5;font-size:1px;filter:alpha(opacity=50);}.olControlPanPanel{top:10px;left:5px;}.olControlPanPanel div{background-image:url(img/pan-panel.png);height:18px;width:18px;cursor:pointer;position:absolute;}.olControlPanPanel .olControlPanNorthItemInactive{top:0;left:9px;background-position:0 0;}.olControlPanPanel .olControlPanSouthItemInactive{top:36px;left:9px;background-position:18px 0;}.olControlPanPanel .olControlPanWestItemInactive{position:absolute;top:18px;left:0;background-position:0 18px;}.olControlPanPanel .olControlPanEastItemInactive{top:18px;left:18px;background-position:18px 18px;}.olControlZoomPanel{top:71px;left:14px;}.olControlZoomPanel div{background-image:url(img/zoom-panel.png);position:absolute;height:18px;width:18px;cursor:pointer;}.olControlZoomPanel .olControlZoomInItemInactive{top:0;left:0;background-position:0 0;}.olControlZoomPanel .olControlZoomToMaxExtentItemInactive{top:18px;left:0;background-position:0 -18px;}.olControlZoomPanel .olControlZoomOutItemInactive{top:36px;left:0;background-position:0 18px;}.olControlPanZoomBar div{font-size:1px;}.olPopupCloseBox{background:url(img/close.gif) no-repeat;cursor:pointer;}.olImageLoadError{background-color:#FFC0CB;opacity:.5;filter:alpha(opacity=50);}.olCursorWait{cursor:wait;}.olDrawBox{cursor:crosshair;}.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown{cursor:0;}.olControlLayerSwitcher{position:absolute;top:25px;right:0;width:20em;font-family:sans-serif;font-weight:700;margin-top:3px;margin-left:3px;margin-bottom:3px;font-size:smaller;color:#FFF;background-color:transparent;}.olControlLayerSwitcher .layersDiv{background-color:#00008B;width:100%;height:100%;padding:5px 75px 5px 10px;}.olControlLayerSwitcher .layersDiv .baseLbl,.olControlLayerSwitcher .layersDiv .dataLbl{margin-top:3px;margin-left:3px;margin-bottom:3px;}.olControlLayerSwitcher .layersDiv .baseLayersDiv,.olControlLayerSwitcher .layersDiv .dataLayersDiv{padding-left:10px;}.olControlLayerSwitcher .maximizeDiv,.olControlLayerSwitcher .minimizeDiv{top:5px;right:0;cursor:pointer;}.olBingAttribution{color:#DDD;}span.olGoogleAttribution a{color:#77C;}.olControlNavToolbar,.olControlEditingToolbar{margin:5px 5px 0 0;}.olControlNavToolbar div,.olControlEditingToolbar div{background-image:url(img/editing_tool_bar.png);background-repeat:no-repeat;width:24px;height:22px;cursor:pointer;margin:0 0 5px 5px;}.olControlEditingToolbar{right:0;top:0;}.olControlNavToolbar{top:295px;left:9px;}.olControlEditingToolbar div{float:right;}.olControlNavToolbar .olControlNavigationItemInactive,.olControlEditingToolbar .olControlNavigationItemInactive{background-position:-103px -1px;}.olControlNavToolbar .olControlNavigationItemActive,.olControlEditingToolbar .olControlNavigationItemActive{background-position:-103px -24px;}.olControlNavToolbar .olControlZoomBoxItemInactive{background-position:-128px -1px;}.olControlNavToolbar .olControlZoomBoxItemActive{background-position:-128px -24px;}.olControlEditingToolbar .olControlDrawFeaturePointItemInactive{background-position:-77px -1px;}.olControlEditingToolbar .olControlDrawFeaturePointItemActive{background-position:-77px -24px;}.olControlEditingToolbar .olControlDrawFeaturePathItemInactive{background-position:-51px -1px;}.olControlEditingToolbar .olControlDrawFeaturePathItemActive{background-position:-51px -24px;}.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{background-position:-26px -1px;}.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive{background-position:-26px -24px;}div.olLayerDiv,.olControlNoSelect{-khtml-user-select:none;-moz-user-select:none;}.olControlOverviewMapMinimizeButton,.olControlOverviewMapMaximizeButton{bottom:80px;cursor:pointer;right:0;}.olPopupContent,.olFramedCloudPopupContent{overflow:auto;padding:5px;}.olDragDown,.olControlDragFeatureOver{cursor:move;}.olBingAttribution.road,.olGoogleAttribution{color:#333;}.olGoogleAttribution.hybrid,.olGoogleAttribution.satellite,span.olGoogleAttribution.hybrid a,span.olGoogleAttribution.satellite a{color:#EEE;}
--------------------------------------------------------------------------------
/theme/default/style.css:
--------------------------------------------------------------------------------
1 | div.olMap {
2 | z-index: 0;
3 | padding: 0 !important;
4 | margin: 0 !important;
5 | cursor: default;
6 | }
7 |
8 | div.olMapViewport {
9 | text-align: left;
10 | }
11 |
12 | div.olLayerDiv {
13 | -moz-user-select: none;
14 | -khtml-user-select: none;
15 | }
16 |
17 | .olLayerGoogleCopyright {
18 | left: 2px;
19 | bottom: 2px;
20 | }
21 | .olLayerGoogleV3.olLayerGoogleCopyright {
22 | right: auto !important;
23 | }
24 | .olLayerGooglePoweredBy {
25 | left: 2px;
26 | bottom: 15px;
27 | }
28 | .olLayerGoogleV3.olLayerGooglePoweredBy {
29 | bottom: 15px !important;
30 | }
31 | .olControlAttribution {
32 | font-size: smaller;
33 | right: 3px;
34 | bottom: 4.5em;
35 | position: absolute;
36 | display: block;
37 | }
38 | .olControlScale {
39 | right: 3px;
40 | bottom: 3em;
41 | display: block;
42 | position: absolute;
43 | font-size: smaller;
44 | }
45 | .olControlScaleLine {
46 | display: block;
47 | position: absolute;
48 | left: 10px;
49 | bottom: 15px;
50 | font-size: xx-small;
51 | }
52 | .olControlScaleLineBottom {
53 | border: solid 2px black;
54 | border-bottom: none;
55 | margin-top:-2px;
56 | text-align: center;
57 | }
58 | .olControlScaleLineTop {
59 | border: solid 2px black;
60 | border-top: none;
61 | text-align: center;
62 | }
63 |
64 | .olControlPermalink {
65 | right: 3px;
66 | bottom: 1.5em;
67 | display: block;
68 | position: absolute;
69 | font-size: smaller;
70 | }
71 |
72 | div.olControlMousePosition {
73 | bottom: 0em;
74 | right: 3px;
75 | display: block;
76 | position: absolute;
77 | font-family: Arial;
78 | font-size: smaller;
79 | }
80 |
81 | .olControlOverviewMapContainer {
82 | position: absolute;
83 | bottom: 0;
84 | right: 0;
85 | }
86 |
87 | .olControlOverviewMapElement {
88 | padding: 10px 18px 10px 10px;
89 | background-color: #00008B;
90 | -moz-border-radius: 1em 0 0 0;
91 | }
92 |
93 | .olControlOverviewMapMinimizeButton {
94 | right: 0;
95 | bottom: 80px;
96 | cursor: pointer;
97 | }
98 |
99 | .olControlOverviewMapMaximizeButton {
100 | right: 0;
101 | bottom: 80px;
102 | cursor: pointer;
103 | }
104 |
105 | .olControlOverviewMapExtentRectangle {
106 | overflow: hidden;
107 | background-image: url("img/blank.gif");
108 | cursor: move;
109 | border: 2px dotted red;
110 | }
111 | .olControlOverviewMapRectReplacement {
112 | overflow: hidden;
113 | cursor: move;
114 | background-image: url("img/overview_replacement.gif");
115 | background-repeat: no-repeat;
116 | background-position: center;
117 | }
118 |
119 | .olLayerGeoRSSDescription {
120 | float:left;
121 | width:100%;
122 | overflow:auto;
123 | font-size:1.0em;
124 | }
125 | .olLayerGeoRSSClose {
126 | float:right;
127 | color:gray;
128 | font-size:1.2em;
129 | margin-right:6px;
130 | font-family:sans-serif;
131 | }
132 | .olLayerGeoRSSTitle {
133 | float:left;font-size:1.2em;
134 | }
135 |
136 | .olPopupContent {
137 | padding:5px;
138 | overflow: auto;
139 | }
140 |
141 | .olControlNavigationHistory {
142 | background-image: url("img/navigation_history.png");
143 | background-repeat: no-repeat;
144 | width: 24px;
145 | height: 24px;
146 |
147 | }
148 | .olControlNavigationHistoryPreviousItemActive {
149 | background-position: 0 0;
150 | }
151 | .olControlNavigationHistoryPreviousItemInactive {
152 | background-position: 0 -24px;
153 | }
154 | .olControlNavigationHistoryNextItemActive {
155 | background-position: -24px 0;
156 | }
157 | .olControlNavigationHistoryNextItemInactive {
158 | background-position: -24px -24px;
159 | }
160 |
161 | div.olControlSaveFeaturesItemActive {
162 | background-image: url(img/save_features_on.png);
163 | background-repeat: no-repeat;
164 | background-position: 0 1px;
165 | }
166 | div.olControlSaveFeaturesItemInactive {
167 | background-image: url(img/save_features_off.png);
168 | background-repeat: no-repeat;
169 | background-position: 0 1px;
170 | }
171 |
172 | .olHandlerBoxZoomBox {
173 | border: 2px solid red;
174 | position: absolute;
175 | background-color: white;
176 | opacity: 0.50;
177 | font-size: 1px;
178 | filter: alpha(opacity=50);
179 | }
180 | .olHandlerBoxSelectFeature {
181 | border: 2px solid blue;
182 | position: absolute;
183 | background-color: white;
184 | opacity: 0.50;
185 | font-size: 1px;
186 | filter: alpha(opacity=50);
187 | }
188 |
189 | .olControlPanPanel {
190 | top: 10px;
191 | left: 5px;
192 | }
193 |
194 | .olControlPanPanel div {
195 | background-image: url(img/pan-panel.png);
196 | height: 18px;
197 | width: 18px;
198 | cursor: pointer;
199 | position: absolute;
200 | }
201 |
202 | .olControlPanPanel .olControlPanNorthItemInactive {
203 | top: 0;
204 | left: 9px;
205 | background-position: 0 0;
206 | }
207 | .olControlPanPanel .olControlPanSouthItemInactive {
208 | top: 36px;
209 | left: 9px;
210 | background-position: 18px 0;
211 | }
212 | .olControlPanPanel .olControlPanWestItemInactive {
213 | position: absolute;
214 | top: 18px;
215 | left: 0;
216 | background-position: 0 18px;
217 | }
218 | .olControlPanPanel .olControlPanEastItemInactive {
219 | top: 18px;
220 | left: 18px;
221 | background-position: 18px 18px;
222 | }
223 |
224 | .olControlZoomPanel {
225 | top: 71px;
226 | left: 14px;
227 | }
228 |
229 | .olControlZoomPanel div {
230 | background-image: url(img/zoom-panel.png);
231 | position: absolute;
232 | height: 18px;
233 | width: 18px;
234 | cursor: pointer;
235 | }
236 |
237 | .olControlZoomPanel .olControlZoomInItemInactive {
238 | top: 0;
239 | left: 0;
240 | background-position: 0 0;
241 | }
242 |
243 | .olControlZoomPanel .olControlZoomToMaxExtentItemInactive {
244 | top: 18px;
245 | left: 0;
246 | background-position: 0 -18px;
247 | }
248 |
249 | .olControlZoomPanel .olControlZoomOutItemInactive {
250 | top: 36px;
251 | left: 0;
252 | background-position: 0 18px;
253 | }
254 |
255 | /*
256 | * When a potential text is bigger than the image it move the image
257 | * with some headers (closes #3154)
258 | */
259 | .olControlPanZoomBar div {
260 | font-size: 1px;
261 | }
262 |
263 | .olPopupCloseBox {
264 | background: url("img/close.gif") no-repeat;
265 | cursor: pointer;
266 | }
267 |
268 | .olFramedCloudPopupContent {
269 | padding: 5px;
270 | overflow: auto;
271 | }
272 |
273 | .olControlNoSelect {
274 | -moz-user-select: none;
275 | -khtml-user-select: none;
276 | }
277 |
278 | .olImageLoadError {
279 | background-color: pink;
280 | opacity: 0.5;
281 | filter: alpha(opacity=50); /* IE */
282 | }
283 |
284 | /**
285 | * Cursor styles
286 | */
287 |
288 | .olCursorWait {
289 | cursor: wait;
290 | }
291 | .olDragDown {
292 | cursor: move;
293 | }
294 | .olDrawBox {
295 | cursor: crosshair;
296 | }
297 | .olControlDragFeatureOver {
298 | cursor: move;
299 | }
300 | .olControlDragFeatureActive.olControlDragFeatureOver.olDragDown {
301 | cursor: -moz-grabbing;
302 | }
303 |
304 | /**
305 | * Layer switcher
306 | */
307 | .olControlLayerSwitcher {
308 | position: absolute;
309 | top: 25px;
310 | right: 0;
311 | width: 20em;
312 | font-family: sans-serif;
313 | font-weight: bold;
314 | margin-top: 3px;
315 | margin-left: 3px;
316 | margin-bottom: 3px;
317 | font-size: smaller;
318 | color: white;
319 | background-color: transparent;
320 | }
321 |
322 | .olControlLayerSwitcher .layersDiv {
323 | padding-top: 5px;
324 | padding-left: 10px;
325 | padding-bottom: 5px;
326 | padding-right: 75px;
327 | background-color: darkblue;
328 | width: 100%;
329 | height: 100%;
330 | }
331 |
332 | .olControlLayerSwitcher .layersDiv .baseLbl,
333 | .olControlLayerSwitcher .layersDiv .dataLbl {
334 | margin-top: 3px;
335 | margin-left: 3px;
336 | margin-bottom: 3px;
337 | }
338 |
339 | .olControlLayerSwitcher .layersDiv .baseLayersDiv,
340 | .olControlLayerSwitcher .layersDiv .dataLayersDiv {
341 | padding-left: 10px;
342 | }
343 |
344 | .olControlLayerSwitcher .maximizeDiv,
345 | .olControlLayerSwitcher .minimizeDiv {
346 | top: 5px;
347 | right: 0;
348 | cursor: pointer;
349 | }
350 |
351 | .olBingAttribution {
352 | color: #DDD;
353 | }
354 | .olBingAttribution.road {
355 | color: #333;
356 | }
357 |
358 | .olGoogleAttribution.hybrid, .olGoogleAttribution.satellite {
359 | color: #EEE;
360 | }
361 | .olGoogleAttribution {
362 | color: #333;
363 | }
364 | span.olGoogleAttribution a {
365 | color: #77C;
366 | }
367 | span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a {
368 | color: #EEE;
369 | }
370 |
371 | /**
372 | * Editing and navigation icons.
373 | * (using the editing_tool_bar.png sprint image)
374 | */
375 | .olControlNavToolbar ,
376 | .olControlEditingToolbar {
377 | margin: 5px 5px 0 0;
378 | }
379 | .olControlNavToolbar div,
380 | .olControlEditingToolbar div {
381 | background-image: url("img/editing_tool_bar.png");
382 | background-repeat: no-repeat;
383 | margin: 0 0 5px 5px;
384 | width: 24px;
385 | height: 22px;
386 | cursor: pointer
387 | }
388 | /* positions */
389 | .olControlEditingToolbar {
390 | right: 0;
391 | top: 0;
392 | }
393 | .olControlNavToolbar {
394 | top: 295px;
395 | left: 9px;
396 | }
397 | /* layouts */
398 | .olControlEditingToolbar div {
399 | float: right;
400 | }
401 | /* individual controls */
402 | .olControlNavToolbar .olControlNavigationItemInactive,
403 | .olControlEditingToolbar .olControlNavigationItemInactive {
404 | background-position: -103px -1px;
405 | }
406 | .olControlNavToolbar .olControlNavigationItemActive ,
407 | .olControlEditingToolbar .olControlNavigationItemActive {
408 | background-position: -103px -24px;
409 | }
410 | .olControlNavToolbar .olControlZoomBoxItemInactive {
411 | background-position: -128px -1px;
412 | }
413 | .olControlNavToolbar .olControlZoomBoxItemActive {
414 | background-position: -128px -24px;
415 | }
416 | .olControlEditingToolbar .olControlDrawFeaturePointItemInactive {
417 | background-position: -77px -1px;
418 | }
419 | .olControlEditingToolbar .olControlDrawFeaturePointItemActive {
420 | background-position: -77px -24px;
421 | }
422 | .olControlEditingToolbar .olControlDrawFeaturePathItemInactive {
423 | background-position: -51px -1px;
424 | }
425 | .olControlEditingToolbar .olControlDrawFeaturePathItemActive {
426 | background-position: -51px -24px;
427 | }
428 | .olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{
429 | background-position: -26px -1px;
430 | }
431 | .olControlEditingToolbar .olControlDrawFeaturePolygonItemActive {
432 | background-position: -26px -24px;
433 | }
434 |
--------------------------------------------------------------------------------
/gpxanim.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys
4 | import os.path
5 | import json
6 | import urllib
7 | import re
8 | from optparse import OptionParser
9 |
10 | __VERSION__ = "0.5"
11 |
12 | def parse_options():
13 | usage = "usage: %prog [options] INFILE.gpx"
14 | desc = "Converts a GPX file into a slippy map animation."
15 |
16 | parser = OptionParser(usage=usage, description=desc,
17 | version="%%prog %s" % __VERSION__)
18 | parser.add_option("-o", "--output", dest="outfile",
19 | help="write video to FILE (default INFILE.ogg)",
20 | metavar="FILE", action="store", type="string")
21 | parser.add_option("-r", "--framerate", dest="framerate",
22 | help="output video framerate (e.g. use 30000/1001 for NTSC, 25.0 for PAL, default=%default)",
23 | metavar="RATE", default="30000/1001",
24 | action="store", type="string")
25 | parser.add_option("-s", "--speedup", dest="speedup",
26 | help="speed-up factor (default %default)",
27 | default="2.0", action="store", type="float")
28 | parser.add_option("--width", dest="width",
29 | help="animation width (default %default)",
30 | default=640, action="store", type="int")
31 | parser.add_option("--height", dest="height",
32 | help="animation height (default %default)",
33 | default=360, action="store", type="int")
34 | parser.add_option("--counter", dest="counter",
35 | help="show the time and a frame counter",
36 | action="store_true")
37 | parser.add_option("--skip", dest="skip", metavar="SECONDS",
38 | help="start animation at a later time (value is in real seconds)",
39 | default=0, action="store", type="float")
40 | parser.add_option("-z", "--zoom", dest="zoom",
41 | help="map zoom (default %default)",
42 | default=16, action="store", type="int")
43 |
44 | parser.add_option("--osm", dest="use_osm",
45 | help="Use OpenStreetMap Mapnik as the base layer (default)",
46 | default=False, action="store_true")
47 | parser.add_option("--google-street", dest="use_google",
48 | help="Use Google Maps as the base layer",
49 | default=False, action="store_true")
50 | parser.add_option("--mapquest", dest="use_mapquest",
51 | help="Use MapQuest Open as the base layer",
52 | default=False, action="store_true")
53 | parser.add_option("--cycle", dest="use_cycle",
54 | help="Use OpenCycleMap as the base layer",
55 | default=False, action="store_true")
56 | parser.add_option("-c", "--track-colour", dest="track_colour",
57 | help="track colour (HTML format, default %default)",
58 | default="red", action="store", type="string")
59 | parser.add_option("--track-opacity", dest="track_opacity",
60 | help="track colour (HTML format)", default=0.6,
61 | action="store", type="float")
62 | parser.add_option("--track-width", dest="track_width",
63 | help="track width in pixels", default=5.0,
64 | action="store", type="float")
65 | parser.add_option("--pilot-colour", dest="pilot_colour",
66 | help="pilot colour (HTML format)", default="red",
67 | action="store", type="string")
68 | parser.add_option("--pilot-opacity", dest="pilot_opacity",
69 | help="pilot colour (HTML format)", default=0.6,
70 | action="store", type="float")
71 | parser.add_option("--pilot-width", dest="pilot_width",
72 | help="pilot width in pixels", default=5.0,
73 | action="store", type="float")
74 | parser.add_option("-p", "--pilot",
75 | action="store_true", dest="pilot", default=False,
76 | help="draw a pilot track before the animation")
77 |
78 | (options, args) = parser.parse_args()
79 |
80 | if len(args) == 0:
81 | parser.print_help()
82 | sys.exit(0)
83 | if len(args) > 1:
84 | parser.error("You must specify a single input GPX file")
85 |
86 | options.gpx_file = args[0]
87 |
88 | if not os.path.exists(options.gpx_file):
89 | parser.error("%s doesn't exist or is inaccessible" % options.gpx_file)
90 |
91 | options.outfile = options.outfile or options_outfilename(options.gpx_file)
92 | options.base_layer = options_check_base_layer(parser, options)
93 | options.framerate_float = options_parse_framerate(parser, options.framerate)
94 |
95 | return options
96 |
97 | def options_outfilename(infilename):
98 | root, ext = os.path.splitext(infilename)
99 | return "%s.ogg" % root
100 |
101 | def options_check_base_layer(parser, options):
102 | default = "M"
103 | base_layer = None
104 | mapping = { "osm": "M", "google": "G", "mapquest": "Q", "cycle": "C" }
105 | for mapname, code in mapping.iteritems():
106 | if getattr(options, "use_%s" % mapname):
107 | if base_layer is None:
108 | base_layer = code
109 | else:
110 | parser.error("You can only specify a single base layer")
111 | return base_layer or default
112 |
113 | def options_parse_framerate(parser, frameratestr):
114 | m = re.match(r"([0-9]*\.?[0-9]*)(?:/([0-9]*\.?[0-9]*))?", frameratestr)
115 | if m:
116 | top = float(m.group(1))
117 | bottom = float(m.group(2) or 1.0)
118 | return top / bottom
119 | parser.error("Incorrect framerate specification \"%s\"" % frameratestr)
120 |
121 | options = parse_options()
122 |
123 | # import gst and gtk after option parsing because they like to steal argv
124 | import gobject
125 | import gtk
126 | import pango
127 | import webkit
128 | import pygst
129 | pygst.require('0.10')
130 | import gst
131 |
132 | class MapWindow(gtk.Window):
133 | def __init__(self, options):
134 | gtk.Window.__init__(self)
135 |
136 | self.set_title("GPX Animator")
137 |
138 | self.width = options.width
139 | self.height = options.height
140 | self.framerate = options.framerate_float
141 | self.speedup = options.speedup
142 |
143 | self.frame_num = 0
144 |
145 | view = webkit.WebView()
146 |
147 | # needed to load other resources
148 | settings = view.get_settings()
149 | settings.set_property('enable-file-access-from-file-uris', 1)
150 |
151 | #view.connect("load-finished", self._view_load_finished_cb)
152 | view.connect("title-changed", self._title_changed_cb)
153 |
154 | view.set_size_request(self.width, self.height)
155 |
156 | alignment = gtk.Alignment(0.0, 0.0, 0.0, 0.0)
157 | alignment.add(view)
158 | self.add(alignment)
159 |
160 | self.connect('destroy', destroy_cb)
161 |
162 | self.show_all()
163 |
164 | self.pipeline, self.snapsrc = gst_pipeline(view, options.outfile,
165 | options.framerate)
166 |
167 | path = os.path.abspath(os.path.dirname(__file__))
168 | loc = "file://%s/gpxanim.html" % path
169 | args = {
170 | "embed": 1,
171 | "track": options.gpx_file,
172 | "layer": options.base_layer,
173 | "z": options.zoom,
174 | "step": self.speedup * 1000.0 / self.framerate,
175 | "width": self.width,
176 | "height": self.height,
177 | "show_counter": "1" if options.counter else "0",
178 | "skip": options.skip,
179 | "pilot": "1" if options.pilot else "0",
180 | "track_colour": options.track_colour,
181 | "track_width": options.track_width,
182 | "track_opacity": options.track_opacity,
183 | "pilot_colour": options.pilot_colour,
184 | "pilot_width": options.pilot_width,
185 | "pilot_opacity": options.pilot_opacity,
186 | }
187 | uri = "%s?%s" % (loc, urllib.urlencode(args))
188 | print "loading: %s" % uri
189 | view.load_uri(uri)
190 |
191 | def _title_changed_cb(self, view, frame, title):
192 | try:
193 | msg = json.loads(frame.get_title())
194 | except ValueError:
195 | msg = None
196 | if msg:
197 | f = getattr(self, "_msg_%s" % msg["msg"], None)
198 | if f:
199 | args = msg.get("object", {})
200 | f(view, **args)
201 | else:
202 | print "*** bugger: couldn't call %s" % msg["msg"]
203 |
204 | def execute(self, view, script, timeout=None):
205 | def idle_execute_script():
206 | view.execute_script(script)
207 | if timeout is None:
208 | gobject.idle_add(idle_execute_script)
209 | else:
210 | gobject.timeout_add(timeout, idle_execute_script)
211 |
212 | def _msg_loaded(self, view):
213 | def begin():
214 | self.execute(view, "Animate.advance();")
215 | begin()
216 |
217 | def _msg_frame(self, view):
218 | self.get_screenshot(view, self.frame_num * 1000 / self.framerate)
219 | self.frame_num += 1
220 | self.execute(view, "Animate.advance();", 10)
221 |
222 | def _msg_finished(self, view):
223 | print "finished"
224 | self.pipeline.set_state(gst.STATE_NULL)
225 | destroy_cb(self)
226 |
227 | def get_screenshot(self, widget, time_ms):
228 | if widget.get_realized():
229 | snapshot = widget.get_snapshot()
230 | w, h = snapshot.get_size()
231 | pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, w, h)
232 | pixbuf.get_from_drawable(snapshot, widget.get_colormap(),
233 | 0, 0, 0, 0, w, h)
234 | #pixbuf.save(self.frame_filename(frame_num), "png")
235 | self.snapsrc.add_snapshot(pixbuf, time_ms)
236 |
237 | @staticmethod
238 | def frame_filename(frame_num):
239 | if frame_num is None:
240 | return "frame.png"
241 | else:
242 | return "frame%05d.png" % frame_num
243 |
244 | def load_requested_cb (widget, text, content_pane):
245 | if not text:
246 | return
247 | content_pane.load(text)
248 |
249 | def destroy_cb(window):
250 | """destroy window resources"""
251 | window.pipeline.set_state(gst.STATE_NULL)
252 | window.destroy()
253 | gtk.main_quit()
254 |
255 | class SnapshotSource(gst.Element):
256 | __gstdetails__ = (
257 | "SnapshotSource plugin",
258 | "convert.py",
259 | "A source of screenshot video frames",
260 | "Rodney Lorrimar ")
261 |
262 | _src_template = gst.PadTemplate("src",
263 | gst.PAD_SRC,
264 | gst.PAD_ALWAYS,
265 | gst.caps_new_any())
266 |
267 | __gsttemplates__ = (_src_template, )
268 |
269 | def __init__(self, framerate=None):
270 | gst.Element.__init__ (self)
271 | self.framerate = framerate
272 | self.src_pad = gst.Pad(self._src_template)
273 | self.src_pad.use_fixed_caps()
274 | self.add_pad(self.src_pad)
275 |
276 | def add_snapshot(self, pixbuf, time_ms):
277 | self.width = pixbuf.get_width()
278 | self.height = pixbuf.get_height()
279 | #print "Pushing %dx%d snapshot to source" % (self.width, self.height)
280 | buf = gst.Buffer(pixbuf.get_pixels())
281 | buf.timestamp = int(round(time_ms * gst.MSECOND))
282 | # Don't forget to set the right caps on the buffer
283 | self.set_caps_on(buf)
284 | src = self.get_static_pad("src")
285 | status = src.push(buf)
286 | if status != gst.FLOW_OK:
287 | raise RuntimeError, "Error while pushing buffer : " + str(status)
288 |
289 | def set_caps_on(self, dest):
290 | """Set the current frame caps on the specified object"""
291 | framerate = ("framerate=%s," % self.framerate) if self.framerate else ""
292 |
293 | # The data is always native-endian xRGB; ffmpegcolorspace
294 | # doesn't support little-endian xRGB, but does support
295 | # big-endian BGRx.
296 | caps = gst.caps_from_string("video/x-raw-rgb,bpp=24,depth=24,\
297 | red_mask=0xff0000,\
298 | green_mask=0x00ff00,\
299 | blue_mask=0x0000ff,\
300 | endianness=4321,\
301 | %swidth=%d,height=%d" \
302 | % (framerate, self.width, self.height))
303 | if dest:
304 | dest.set_caps(caps)
305 |
306 | def _src_setcaps(self, pad, caps):
307 | #we negotiate our capabilities here, this function is called
308 | #as autovideosink accepts anything, we just say yes we can handle the
309 | #incoming data
310 | return True
311 |
312 | def _src_chain(self, pad, buf):
313 | #this is where we do filtering
314 | #and then push a buffer to the next element, returning a value saying
315 | # it was either successful or not.
316 | return self.srcpad.push(buf)
317 |
318 | gobject.type_register(SnapshotSource)
319 |
320 | def gst_pipeline(widget, outfile=None, framerate=None):
321 | ## this code creates the following pipeline, equivalent to
322 | ## gst-launch-0.10 SnapshotSource ! videoscale ! ffmpegcolorspace ! autovideosink
323 |
324 | # first create individual gstreamer elements
325 |
326 | snapsrc = SnapshotSource(framerate)
327 | vscale = gst.element_factory_make("videoscale")
328 | cspace = gst.element_factory_make("ffmpegcolorspace")
329 |
330 | elements = [snapsrc, vscale, cspace]
331 |
332 | if outfile:
333 | print "recording to %s" % outfile
334 | videorate = gst.element_factory_make("videorate")
335 | theoraenc = gst.element_factory_make("theoraenc")
336 | oggmux = gst.element_factory_make("oggmux")
337 | filesink = gst.parse_launch ("filesink location=%s" % outfile)
338 | if not filesink:
339 | raise RuntimeError, "Can't create filesink element"
340 | elements.extend([videorate, theoraenc, oggmux, filesink])
341 | else:
342 | vsink = gst.element_factory_make("autovideosink")
343 | elements.append(vsink)
344 |
345 | # create the pipeline
346 | p = gst.Pipeline()
347 | p.add(*elements)
348 | gst.element_link_many(*elements)
349 |
350 | # set pipeline to playback state
351 | p.set_state(gst.STATE_PLAYING)
352 |
353 | return p, snapsrc
354 |
355 | if __name__ == "__main__":
356 | window = MapWindow(options)
357 | gtk.main()
358 |
--------------------------------------------------------------------------------
/gpxanim.js:
--------------------------------------------------------------------------------
1 | var Animate = (function($) {
2 | var map;
3 | var gpx_layer;
4 | var animate_layer;
5 | var trackurl;
6 | var baselayer;
7 |
8 | // http://stackoverflow.com/a/2880929/405240
9 | var urlparams = {};
10 | (function () {
11 | var e,
12 | a = /\+/g, // Regex for replacing addition symbol with a space
13 | r = /([^&=]+)=?([^&]*)/g,
14 | d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
15 | q = window.location.search.substring(1);
16 |
17 | while (e = r.exec(q))
18 | urlparams[d(e[1])] = d(e[2]);
19 | })();
20 |
21 | trackurl = urlparams.track || "track.gpx";
22 | baselayer = urlparams.layer || "M";
23 | zoom = parseInt(urlparams.z) || 14;
24 | step = parseFloat(urlparams.step) || 1000; // number of ms to advance each frame
25 | interval = parseInt(urlparams.interval) || step; // ms interval between updates
26 | skip = parseInt(urlparams.skip) || 0;
27 | embed = parseInt(urlparams.embed) || false;
28 | width = urlparams.width || 640;
29 | height = urlparams.height || 360;
30 | pilot = parseInt(urlparams.pilot) ? true : false;
31 | track_colour = urlparams.track_colour || "#69C";
32 | pilot_colour = urlparams.pilot_colour || "#808080";
33 | track_opacity = parseFloat(urlparams.track_opacity) || 0.6;
34 | pilot_opacity = parseFloat(urlparams.pilot_opacity) || 0.5;
35 | track_width = parseFloat(urlparams.track_width) || 5;
36 | pilot_width = parseFloat(urlparams.pilot_width) || 5;
37 | show_counter = parseInt(urlparams.show_counter) ? true : false
38 |
39 | var create_gpx_layer = function(name, url, colour) {
40 | var lgpx = new OpenLayers.Layer.GML(name, url, {
41 | format: OpenLayers.Format.GPX,
42 | style: { strokeColor: colour,
43 | strokeWidth: pilot_width,
44 | strokeOpacity: pilot_opacity },
45 | projection: new OpenLayers.Projection("EPSG:4326")
46 | });
47 | return lgpx;
48 | };
49 |
50 | var create_animate_layer = function(name, url, colour) {
51 | var lgpx = new OpenLayers.Layer.Vector.Animate(name, url, {
52 | strategies: [
53 | new OpenLayers.Strategy.Fixed(),
54 | new OpenLayers.Strategy.Animate({
55 | step: step, interval: interval, skip: skip * 1000
56 | })
57 | ],
58 | protocol: new OpenLayers.Protocol.HTTP({
59 | url: url,
60 | format: new OpenLayers.Format.GPX2({
61 | extractStyles: false, // fixme: probably not used
62 | //maxDepth: 2, // fixme: what is this?
63 | extractAttributes: true,
64 | extractTracks: true,
65 | extractRoutes: false,
66 | extractWaypoints: false
67 | })
68 | }),
69 | style: { strokeColor: colour,
70 | strokeWidth: track_width,
71 | strokeOpacity: track_opacity },
72 | projection: new OpenLayers.Projection("EPSG:4326")
73 | });
74 |
75 | return lgpx;
76 | };
77 |
78 | var map_init = function(){
79 | var layermap = { "M": 0, "C": 1, "G": 3, "Q": 2 };
80 | gpx_layer = create_gpx_layer("Track", trackurl, pilot_colour);
81 | animate_layer = create_animate_layer("Animation", trackurl, track_colour);
82 | map = new OpenLayers.Map("map", {
83 | controls: [
84 | new OpenLayers.Control.Navigation()
85 | //new OpenLayers.Control.PanZoom()
86 | ],
87 | layers: [
88 | new OpenLayers.Layer.OSM.Mapnik("OSM"),
89 | new OpenLayers.Layer.OSM.CycleMap("Cycle"),
90 | new OpenLayers.Layer.OSM.MapQuest("MapQuest-OSM"),
91 | new OpenLayers.Layer.Google("Google Streets",
92 | {numZoomLevels: 20}),
93 | ]
94 | });
95 |
96 | if (pilot) {
97 | map.addLayer(gpx_layer);
98 | }
99 |
100 | map.addLayer(animate_layer);
101 |
102 | map.setBaseLayer(map.layers[layermap[baselayer] || 0]);
103 |
104 | map.baseLayer.events.on({ loadstart: baselayer_loadstart,
105 | loadend: baselayer_loadend });
106 |
107 | gpx_layer.events.register('loadend', gpx_layer, function() {
108 | var bounds = this.getDataExtent();
109 | //map.zoomToExtent(bounds);
110 | map.setCenter(bounds.getCenterLonLat(), zoom);
111 | });
112 |
113 | animate_layer.events.register('loadend', animate_layer, function() {
114 | this.setup();
115 | if (embed) {
116 | send("loaded");
117 | } else {
118 | this.start();
119 | }
120 | });
121 |
122 | map.setCenter(
123 | new OpenLayers.LonLat(4.69005, 50.86739).transform(
124 | new OpenLayers.Projection("EPSG:4326"),
125 | map.getProjectionObject()
126 | ), zoom
127 | );
128 |
129 | return map;
130 | };
131 |
132 | var setup_buttons = function() {
133 | $("#start-btn").click(function(ev) {
134 | ev.preventDefault();
135 | animate_layer.start();
136 | });
137 | $("#stop-btn").click(function(ev) {
138 | ev.preventDefault();
139 | animate_layer.stop();
140 | });
141 | };
142 |
143 | var setup_embed = function(embed) {
144 | if (embed) {
145 | $("body").children().not(".clipper").hide();
146 | $(".clipper, body").addClass("embed");
147 | $("#counter").show();
148 | }
149 | };
150 |
151 | var setup_size = function(width, height) {
152 | // normally this is done through css -- but it doesn't seem to
153 | // work with the embedded webkit -- possibly because resize events
154 | // aren't sent to webkit
155 |
156 | var diameter = Math.sqrt(width*width + height*height);
157 | $(".clipper").width(width).height(height);
158 | $(".rotated")
159 | .width(diameter).height(diameter)
160 | .css("left", (width - diameter) / 2 + "px")
161 | .css("top", (height - diameter) / 2 + "px")
162 | .css("position", "relative");
163 | };
164 |
165 | var setup_counter = function(show) {
166 | var $cont = $(".clipper"), $el = $("#counter");
167 | var pos = $cont.position();
168 |
169 | $el.css({ "position": "absolute",
170 | "left": pos.left + $cont.width() - $el.outerWidth(),
171 | "top": pos.top + $cont.height() - $el.outerHeight() })
172 | .toggle(show);
173 | };
174 |
175 | var ready_basic = function() {
176 | map_init();
177 | setup_buttons();
178 | setup_embed(embed);
179 | setup_size(width, height);
180 | setup_counter(show_counter);
181 | };
182 |
183 | var send = function(msg, object) {
184 | document.title = "null";
185 | document.title = JSON.stringify({ msg: msg, object: object });
186 | };
187 |
188 | var tiles_loading = false;
189 | var queue_frame = false;
190 |
191 | var baselayer_loadstart = function() {
192 | //console.log("baselayer: loadstart");
193 | tiles_loading = true;
194 | };
195 |
196 | var baselayer_loadend = function() {
197 | //console.log("baselayer: loadend");
198 | tiles_loading = false;
199 | if (queue_frame) {
200 | send("frame");
201 | queue_frame = false;
202 | }
203 | };
204 |
205 | var send_frame = function() {
206 | var layer = map.baseLayer;
207 | if (!layer.numLoadingTiles) {
208 | send("frame");
209 | } else {
210 | console.log("waiting for " + layer.numLoadingTiles + " tiles to load");
211 | queue_frame = true;
212 | }
213 | };
214 |
215 | return {
216 | ready_basic: ready_basic,
217 | get_map: function() { return map; },
218 | start: function() {
219 | animate_layer.start();
220 | },
221 | advance: function() {
222 | animate_layer.advance(function() {
223 | send_frame();
224 | }, function() {
225 | send("finished");
226 | });
227 | }
228 | };
229 | })(jQuery);
230 |
231 | OpenLayers.Layer.Vector.Animate = OpenLayers.Class(OpenLayers.Layer.Vector, {
232 | initialize: function(name, url, options) {
233 | var newArguments = [name, options];
234 | OpenLayers.Layer.Vector.prototype.initialize.apply(this, newArguments);
235 | this.url = url;
236 | },
237 |
238 | setup: function() {
239 | this.strat = this.strategies[1]; // fixme: dumb
240 | this.strat.frame_num = 0;
241 | this.strat.time = this.strat.min_time;
242 | this.strat.time += this.strat.skip;
243 | this.strat.animate();
244 | },
245 |
246 | advance: function(next_cb, finished_cb) {
247 | var self = this;
248 | var real_advance = function() {
249 | var strat = self.strat;
250 | strat.time += strat.step;
251 | strat.frame_num++;
252 | if (strat.time > strat.max_time) {
253 | return false;
254 | } else {
255 | strat.animate();
256 | self.map.setCenter(new OpenLayers.LonLat(strat.last_point.x, strat.last_point.y));
257 | self.set_speed(strat.last_point.attributes.speed);
258 | self.set_course(strat.last_point.attributes.course);
259 | self.set_timing(strat.frame_num, strat.time - strat.min_time);
260 | return true;
261 | }
262 | };
263 |
264 | /* put the advance function on a timeout so openlayers can get in
265 | * and load its tiles */
266 | window.setTimeout(function() {
267 | if (real_advance()) {
268 | next_cb();
269 | } else {
270 | finished_cb();
271 | }
272 | }, 1);
273 | },
274 |
275 | start: function() {
276 | var self = this;
277 |
278 | if (this.interval_id) {
279 | return;
280 | }
281 |
282 | self.interval_id = window.setInterval(function() {
283 | self.advance(function() { }, function() { self.stop(); });
284 | }, self.strat.interval);
285 | },
286 |
287 | stop: function() {
288 | if (this.interval_id) {
289 | window.clearTimeout(this.interval_id);
290 | this.interval_id = null;
291 | }
292 | },
293 |
294 | set_speed: function(speed) {
295 | $("#speed").text(speed + "m/s");
296 | },
297 |
298 | set_course: function(deg) {
299 | var rotate = "rotate(" + (-deg) + "deg)";
300 | $("#map").css({
301 | "-ms-transform": rotate,
302 | "-moz-transform": rotate,
303 | "-webkit-transform": rotate,
304 | "-o-transform": rotate
305 | });
306 | },
307 |
308 | set_timing: function(frame_num, time) {
309 | $("#frame").text(frame_num);
310 | $("#time").text(Math.round(time));
311 | },
312 |
313 | CLASS_NAME: "OpenLayers.Layer.Vector.Animate"
314 | });
315 |
316 | OpenLayers.Strategy.Animate = OpenLayers.Class(OpenLayers.Strategy, {
317 |
318 | /**
319 | * Property: features
320 | * {Array()} Cached features.
321 | */
322 | features: null,
323 |
324 | /**
325 | * Property: animation
326 | * {Array()} What is visible so far.
327 | */
328 | animation: null,
329 |
330 | /**
331 | * APIProperty: rest
332 | * {Array()} Points not yet drawn.
333 | */
334 | rest: null,
335 |
336 | /**
337 | * APIProperty: points
338 | * {Array()} All points
339 | */
340 | points: null,
341 |
342 | /**
343 | * APIProperty: last_point
344 | * {} Most recently drawn point
345 | */
346 | last_point: null,
347 |
348 | /**
349 | * Property: animating
350 | * {Boolean} The strategy is currently animating features.
351 | */
352 | animating: false,
353 |
354 | /**
355 | * Property: step
356 | * {Integer} The time in ms to advance each frame
357 | */
358 | step: 1000,
359 |
360 | /**
361 | * Property: interval
362 | * {Integer} The time in milliseconds between animation updates
363 | */
364 | interval: 1000,
365 |
366 | /**
367 | * Property: skip
368 | * {Integer} Time in ms at which to begin animation
369 | */
370 | skip: 0,
371 |
372 | /**
373 | * Property: time
374 | * {Integer} The current animation time.
375 | */
376 | time: 0,
377 |
378 | /**
379 | * Property: min_time
380 | * {Integer} The start time.
381 | */
382 | min_time: 0,
383 |
384 | /**
385 | * Property: max_time
386 | * {Integer} The end time.
387 | */
388 | max_time: 0,
389 |
390 | /**
391 | * Constructor: OpenLayers.Strategy.Cluster
392 | * Create a new clustering strategy.
393 | *
394 | * Parameters:
395 | * options - {Object} Optional object whose properties will be set on the
396 | * instance.
397 | */
398 |
399 | /**
400 | * APIMethod: activate
401 | * Activate the strategy. Register any listeners, do appropriate setup.
402 | *
403 | * Returns:
404 | * {Boolean} The strategy was successfully activated.
405 | */
406 | activate: function() {
407 | var activated = OpenLayers.Strategy.prototype.activate.call(this);
408 | if(activated) {
409 | this.layer.events.on({
410 | "beforefeaturesadded": this.cacheFeatures,
411 | //"moveend": this.cluster,
412 | scope: this
413 | });
414 | }
415 | return activated;
416 | },
417 |
418 | /**
419 | * APIMethod: deactivate
420 | * Deactivate the strategy. Unregister any listeners, do appropriate
421 | * tear-down.
422 | *
423 | * Returns:
424 | * {Boolean} The strategy was successfully deactivated.
425 | */
426 | deactivate: function() {
427 | var deactivated = OpenLayers.Strategy.prototype.deactivate.call(this);
428 | if(deactivated) {
429 | this.clearCache();
430 | this.layer.events.un({
431 | "beforefeaturesadded": this.cacheFeatures,
432 | //"moveend": this.cluster,
433 | scope: this
434 | });
435 | }
436 | return deactivated;
437 | },
438 |
439 | /**
440 | * Method: cacheFeatures
441 | * Cache features before they are added to the layer.
442 | *
443 | * Parameters:
444 | * event - {Object} The event that this was listening for. This will come
445 | * with a batch of features to be clustered.
446 | *
447 | * Returns:
448 | * {Boolean} False to stop features from being added to the layer.
449 | */
450 | cacheFeatures: function(event) {
451 | var propagate = true;
452 | if(!this.animating) {
453 | var self = this;
454 | this.clearCache();
455 | this._init_range();
456 | this.features = event.features;
457 | this.last_point = null;
458 | this.animation = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([]));
459 |
460 | this.animating = true;
461 | this.layer.addFeatures(this.animation);
462 | this.animating = false;
463 |
464 | // btw jQuery.map() flattens 2-d arrays and filters nulls
465 | this.points = $.map(this.features, function(feature) {
466 | var components = self.getLineStringComponents(feature);
467 | if (components) {
468 | self._update_range(components);
469 | return components;
470 | }
471 | return null;
472 | });
473 | this.rest = this.points.slice(0);
474 | //console.log("min=" + self.min_time + " max=" + self.max_time);
475 | this.time = this.min_time;
476 | this.animate();
477 | propagate = false;
478 | }
479 | return propagate;
480 | },
481 |
482 | // more or less approximate test
483 | getLineStringComponents: function(feature) {
484 | return feature.geometry && feature.geometry.components ? feature.geometry.components : null;
485 | },
486 |
487 | _init_range: function() {
488 | this.min_time = this.max_time = undefined;
489 | },
490 |
491 | _update_range: function(points) {
492 | var self = this;
493 |
494 | $.each(points, function(i, point) {
495 | if (point.attributes && point.attributes.time) {
496 | if (self.min_time === undefined ||
497 | self.min_time > point.attributes.time) {
498 | self.min_time = point.attributes.time;
499 | }
500 | if (self.max_time === undefined ||
501 | self.max_time < point.attributes.time) {
502 | self.max_time = point.attributes.time;
503 | }
504 | }
505 | });
506 | },
507 |
508 |
509 | /**
510 | * Method: clearCache
511 | * Clear out the cached features.
512 | */
513 | clearCache: function() {
514 | this.features = null;
515 | },
516 |
517 | angle_lerp: function(a, b, f) {
518 | var norm2 = function(angle, mod, min, max) {
519 | while (angle < 0.0)
520 | angle += 360.0;
521 | while (angle >= 360.0)
522 | angle -= 360.0;
523 | return angle;
524 | };
525 | var norm = function(angle) {
526 | return norm2(angle, 360.0, 0.0, 360.0);
527 | };
528 | var dnorm = function(angle) {
529 | return norm2(angle, 180.0, 0.0, 180.0);
530 | };
531 | var diff, dir;
532 |
533 | a = norm(a);
534 | b = norm(b);
535 | diff = b - a;
536 | if (diff >= 180.0 || diff < 0.0) {
537 | // interp in the reverse direction if that would be shorter
538 | diff = -dnorm(-diff);
539 | }
540 |
541 | return norm(a + diff * f);
542 | },
543 |
544 | /**
545 | * Method: animate
546 | * Filter features based on some time threshold.
547 | *
548 | * Parameters:
549 | * event - {Object} The event received when animate is called as a
550 | * result of a moveend event.
551 | */
552 | animate: function(event) {
553 | var new_points = [];
554 | var self = this;
555 | var next_point = null;
556 | var last_point = null;
557 | var current_index;
558 |
559 | //console.log("animate: " + this.time);
560 |
561 | // points list needs to be sorted by time
562 | $.each(self.rest, function(i, point) {
563 | if (point.attributes && point.attributes.time) {
564 | if (point.attributes.time <= self.time) {
565 | //console.log("adding point " + point.attributes.time);
566 | new_points.push(point);
567 | self.last_point = point;
568 | self.last_real_point = point;
569 | } else {
570 | next_point = point;
571 | return false;
572 | }
573 | }
574 | });
575 |
576 | $.each(new_points, function() {
577 | self.rest.shift();
578 | });
579 |
580 | current_index = self.points.length - self.rest.length - 1;
581 |
582 | last_point = self.last_real_point;
583 |
584 | // check if interpolation needs to be done for next point
585 | if (next_point && next_point.attributes && next_point.attributes.time &&
586 | last_point) {
587 | //var delta = next_point.attributes.time - this.time - this.step;
588 | var delta = this.time - last_point.attributes.time;
589 | if (delta > 0) {
590 | // linear interpolation
591 | var f = delta /
592 | (next_point.attributes.time - last_point.attributes.time);
593 | var twerp = last_point.clone();
594 | //console.log("interpolating time=" + this.time + ", delta=" + delta + " f=" + f + ", last=" + last_point.attributes.time + ", next=" + next_point.attributes.time + ", step=" + this.step);
595 | //console.log("before=" + (last_point.attributes.time - this.time) + " after=" + (next_point.attributes.time - this.time));
596 |
597 | twerp.x += f * (next_point.x - last_point.x);
598 | twerp.y += f * (next_point.y - last_point.y);
599 | twerp.attributes.course = this.angle_lerp(last_point.attributes.course, next_point.attributes.course, f);
600 | new_points.push(twerp);
601 | this.last_point = twerp;
602 | } else {
603 | //console.log("not interpolating: delta=" + delta);
604 | }
605 | }
606 |
607 | this.animation.geometry.addComponents(new_points);
608 |
609 | // not sure which method to call for redraw -- go with layer for now
610 | this.layer.redraw();
611 | },
612 |
613 | CLASS_NAME: "OpenLayers.Strategy.Animate"
614 | });
615 |
616 | /* GPX format modified to extract attributes of each track point */
617 | OpenLayers.Format.GPX2 = OpenLayers.Class(OpenLayers.Format.GPX, {
618 | /**
619 | * Method: extractSegment
620 | *
621 | * Parameters:
622 | * segment - {DOMElement} a trkseg or rte node to parse
623 | * segmentType - {String} nodeName of waypoints that form the line
624 | *
625 | * Returns:
626 | * {} A linestring geometry
627 | */
628 | extractSegment: function(segment, segmentType) {
629 | var points = this.getElementsByTagNameNS(segment, segment.namespaceURI, segmentType);
630 | var point_features = [];
631 | for (var i = 0, len = points.length; i < len; i++) {
632 | var point = new OpenLayers.Geometry.Point(points[i].getAttribute("lon"), points[i].getAttribute("lat"));
633 | if (this.extractAttributes) {
634 | point.attributes = this.parseAttributes(points[i]);
635 | point.attributes.time = this.parseTime(point.attributes.time);
636 | point.attributes.speed = parseFloat(point.attributes.speed);
637 | point.attributes.course = parseFloat(point.attributes.course);
638 | }
639 | point_features.push(point);
640 | }
641 | return new OpenLayers.Geometry.LineString(point_features);
642 | },
643 |
644 | parseTime: function(time) {
645 | if (time) {
646 | time = Date.parse(time);
647 | }
648 | return time;
649 | },
650 |
651 | CLASS_NAME: "OpenLayers.Format.GPX2"
652 | });
653 |
654 | OpenLayers.Layer.OSM.MapQuest = OpenLayers.Class(OpenLayers.Layer.OSM, {
655 | /**
656 | * Constructor: OpenLayers.Layer.OSM.MapQuest
657 | *
658 | * Parameters:
659 | * name - {String}
660 | * options - {Object} Hashtable of extra options to tag onto the layer
661 | */
662 | initialize: function(name, options) {
663 | var url = [
664 | "http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
665 | "http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
666 | "http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
667 | "http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"
668 | ];
669 | options = OpenLayers.Util.extend({
670 | numZoomLevels: 19,
671 | buffer: 0,
672 | transitionEffect: "resize"
673 | }, options);
674 | var newArguments = [name, url, options];
675 | OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
676 | },
677 |
678 | CLASS_NAME: "OpenLayers.Layer.OSM.MapQuest"
679 | });
680 |
--------------------------------------------------------------------------------
/jquery-1.7.2.min.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v1.7.2 jquery.com | jquery.org/license */
2 | (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;ca",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q=""+"",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
3 | a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,""],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
4 | .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>$2>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/