active_frontend 12.4.32 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -1
- data/.gitignore +1 -1
- data/.rspec +1 -1
- data/.travis.yml +1 -1
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/active_frontend.gemspec +1 -1
- data/app/assets/fonts/dripicons/dripicons-weather.woff +0 -0
- data/app/assets/fonts/dripicons/dripicons.woff +0 -0
- data/app/assets/images/placeholders/camera-large.png +0 -0
- data/app/assets/images/placeholders/camera-small.png +0 -0
- data/app/assets/images/placeholders/camera.png +0 -0
- data/app/assets/images/placeholders/picture-large.png +0 -0
- data/app/assets/images/placeholders/picture-small.png +0 -0
- data/app/assets/images/placeholders/picture.png +0 -0
- data/app/assets/images/placeholders/store-large.png +0 -0
- data/app/assets/images/placeholders/store-small.png +0 -0
- data/app/assets/images/placeholders/store.png +0 -0
- data/app/assets/images/placeholders/user-large.png +0 -0
- data/app/assets/images/placeholders/user-small.png +0 -0
- data/app/assets/images/placeholders/user.png +0 -0
- data/app/helpers/active_frontend_helper.rb +2 -2
- data/lib/active_frontend/version.rb +2 -2
- data/lib/active_frontend.rb +1 -1
- data/lib/generators/active_frontend/install_generator.rb +1 -1
- data/lib/generators/active_frontend/templates/install.js +1 -1
- data/lib/generators/active_frontend/templates/install.scss +1 -1
- data/vendor/assets/javascripts/_affix.js +1 -1
- data/vendor/assets/javascripts/_alert.js +1 -1
- data/vendor/assets/javascripts/_animation.js +1 -1
- data/vendor/assets/javascripts/_button.js +1 -1
- data/vendor/assets/javascripts/_carousel.js +1 -1
- data/vendor/assets/javascripts/_chart.js +8 -8
- data/vendor/assets/javascripts/_collapse.js +1 -1
- data/vendor/assets/javascripts/_color_picker.js +1 -1
- data/vendor/assets/javascripts/_date_picker.js +1 -1
- data/vendor/assets/javascripts/_dropdown.js +1 -1
- data/vendor/assets/javascripts/_file_input.js +1 -1
- data/vendor/assets/javascripts/_hoverdown.js +1 -1
- data/vendor/assets/javascripts/_inputmask.js +1 -1
- data/vendor/assets/javascripts/_loader.js +1 -1
- data/vendor/assets/javascripts/_map.js +149 -10
- data/vendor/assets/javascripts/_modal.js +1 -1
- data/vendor/assets/javascripts/_popover.js +1 -1
- data/vendor/assets/javascripts/_scrollspy.js +1 -1
- data/vendor/assets/javascripts/_slider.js +1 -1
- data/vendor/assets/javascripts/_sort.js +1 -1
- data/vendor/assets/javascripts/_swoggle.js +1 -1
- data/vendor/assets/javascripts/_tab.js +1 -1
- data/vendor/assets/javascripts/_tablespy.js +1 -1
- data/vendor/assets/javascripts/_time_ago.js +1 -1
- data/vendor/assets/javascripts/_time_picker.js +1 -1
- data/vendor/assets/javascripts/_tooltip.js +1 -1
- data/vendor/assets/javascripts/_transition.js +1 -1
- data/vendor/assets/javascripts/_typeahead.js +1 -1
- data/vendor/assets/javascripts/active_frontend.js +1 -1
- data/vendor/assets/stylesheets/_ad.scss +2 -2
- data/vendor/assets/stylesheets/_affix.scss +1 -1
- data/vendor/assets/stylesheets/_alert.scss +3 -16
- data/vendor/assets/stylesheets/_animation.scss +1 -1
- data/vendor/assets/stylesheets/_breadcrumb.scss +3 -18
- data/vendor/assets/stylesheets/_button.scss +33 -39
- data/vendor/assets/stylesheets/_canvas.scss +1 -1
- data/vendor/assets/stylesheets/_carousel.scss +2 -2
- data/vendor/assets/stylesheets/_chart.scss +1 -1
- data/vendor/assets/stylesheets/_code.scss +3 -3
- data/vendor/assets/stylesheets/_collapse.scss +2 -2
- data/vendor/assets/stylesheets/_color.scss +2 -2
- data/vendor/assets/stylesheets/_colorpicker.scss +20 -5
- data/vendor/assets/stylesheets/_datepicker.scss +7 -5
- data/vendor/assets/stylesheets/_dropdown.scss +12 -9
- data/vendor/assets/stylesheets/_footer.scss +4 -5
- data/vendor/assets/stylesheets/_form.scss +51 -50
- data/vendor/assets/stylesheets/_grid.scss +1 -1
- data/vendor/assets/stylesheets/_header.scss +53 -497
- data/vendor/assets/stylesheets/_icon.scss +321 -1489
- data/vendor/assets/stylesheets/_image.scss +1 -1
- data/vendor/assets/stylesheets/_label_and_badge.scss +1 -1
- data/vendor/assets/stylesheets/_link.scss +41 -2
- data/vendor/assets/stylesheets/_list.scss +3 -3
- data/vendor/assets/stylesheets/_loader.scss +1 -1
- data/vendor/assets/stylesheets/_map.scss +1 -1
- data/vendor/assets/stylesheets/_missive.scss +1 -1
- data/vendor/assets/stylesheets/_mixin.scss +1 -1
- data/vendor/assets/stylesheets/_modal.scss +1 -1
- data/vendor/assets/stylesheets/_nav_and_tab.scss +1 -1
- data/vendor/assets/stylesheets/_navbar.scss +8 -16
- data/vendor/assets/stylesheets/_pagination.scss +9 -5
- data/vendor/assets/stylesheets/_panel.scss +4 -4
- data/vendor/assets/stylesheets/_placeholder.scss +3 -4
- data/vendor/assets/stylesheets/_popover.scss +2 -2
- data/vendor/assets/stylesheets/_progress.scss +1 -1
- data/vendor/assets/stylesheets/_reset.scss +6 -4
- data/vendor/assets/stylesheets/_sidebar.scss +9 -141
- data/vendor/assets/stylesheets/_slider.scss +9 -9
- data/vendor/assets/stylesheets/_spinner.scss +6 -4
- data/vendor/assets/stylesheets/_subheader.scss +19 -180
- data/vendor/assets/stylesheets/_swoggle.scss +3 -3
- data/vendor/assets/stylesheets/_table.scss +20 -11
- data/vendor/assets/stylesheets/_timepicker.scss +7 -10
- data/vendor/assets/stylesheets/_toolbar.scss +8 -21
- data/vendor/assets/stylesheets/_tooltip.scss +4 -3
- data/vendor/assets/stylesheets/_transition.scss +1 -1
- data/vendor/assets/stylesheets/_trunk.scss +16 -24
- data/vendor/assets/stylesheets/_typeahead.scss +2 -7
- data/vendor/assets/stylesheets/_typography.scss +1 -1
- data/vendor/assets/stylesheets/_variable.scss +1 -1
- data/vendor/assets/stylesheets/active_frontend.scss +1 -1
- metadata +15 -8
- data/app/assets/fonts/ionicons/ionicons.eot +0 -0
- data/app/assets/fonts/ionicons/ionicons.svg +0 -2232
- data/app/assets/fonts/ionicons/ionicons.ttf +0 -0
- data/app/assets/fonts/ionicons/ionicons.woff +0 -0
- data/app/assets/images/placeholders/person.png +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 395efb468d9b69cd0a9dc022d46d1e35510eb1cf
|
|
4
|
+
data.tar.gz: b1c9827c6dc0b171bdd27dcddeefa062472a8ab7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a985a9b53edabca4eed8a2db63c865112fc27970b38b132cdb02349f698422414d36eac4903e4cc49e446a5abbd5274750f396cb4e44f1335bb22dfd26487c9f
|
|
7
|
+
data.tar.gz: 8425408dd38fad6d474020fa0aae4d4abc1b7de51274bfe9e203694fbff8412d4f3ffe37195a95eb9caf59c648e30204f7211f86cce4f317fa79878137df70f7
|
data/.coveralls.yml
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
service_name: travis-ci
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -10,4 +10,4 @@ Project maintainers have the right and responsibility to remove, edit, or reject
|
|
|
10
10
|
|
|
11
11
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
|
12
12
|
|
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -129,4 +129,4 @@ Add the JS files you want to include:
|
|
|
129
129
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
130
130
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
131
131
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
132
|
-
5. Create a new Pull Request
|
|
132
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
data/active_frontend.gemspec
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -27,7 +27,7 @@ module ActiveFrontendHelper
|
|
|
27
27
|
pink: { rgba: "rgba(255,0,102,#{opacity})", hex: "#FF0066" },
|
|
28
28
|
red: { rgba: "rgba(240,35,17,#{opacity})", hex: "#F02311" },
|
|
29
29
|
orange: { rgba: "rgba(248,122,9,#{opacity})", hex: "#F87A09" },
|
|
30
|
-
yellow: { rgba: "rgba(
|
|
30
|
+
yellow: { rgba: "rgba(245,200,0,#{opacity})", hex: "#F5C800" },
|
|
31
31
|
lime_alt: { rgba: "rgba(181,228,78,#{opacity})", hex: "#B5E44E" },
|
|
32
32
|
green_alt: { rgba: "rgba(100,194,28,#{opacity})", hex: "#64C21C" },
|
|
33
33
|
teal_alt: { rgba: "rgba(120,206,205,#{opacity})", hex: "#78CECD" },
|
|
@@ -41,4 +41,4 @@ module ActiveFrontendHelper
|
|
|
41
41
|
}
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
-
end
|
|
44
|
+
end
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module ActiveFrontend
|
|
2
|
-
VERSION = "
|
|
3
|
-
end
|
|
2
|
+
VERSION = "13.0.0"
|
|
3
|
+
end
|
data/lib/active_frontend.rb
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
scaleFontFamily: "'Gotham Round', 'Gotham', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
|
86
86
|
|
|
87
87
|
// Number - Scale label font size in pixels
|
|
88
|
-
scaleFontSize:
|
|
88
|
+
scaleFontSize: 13,
|
|
89
89
|
|
|
90
90
|
// String - Scale label font weight style
|
|
91
91
|
scaleFontStyle: "bold",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
tooltipFontFamily: "'Gotham Round', 'Gotham', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
|
116
116
|
|
|
117
117
|
// Number - Tooltip label font size in pixels
|
|
118
|
-
tooltipFontSize:
|
|
118
|
+
tooltipFontSize: 12,
|
|
119
119
|
|
|
120
120
|
// String - Tooltip font weight style
|
|
121
121
|
tooltipFontStyle: "bold",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
tooltipTitleFontFamily: "'Gotham Round', 'Gotham', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
|
128
128
|
|
|
129
129
|
// Number - Tooltip title font size in pixels
|
|
130
|
-
tooltipTitleFontSize:
|
|
130
|
+
tooltipTitleFontSize: 12,
|
|
131
131
|
|
|
132
132
|
// String - Tooltip title font weight style
|
|
133
133
|
tooltipTitleFontStyle: "bold",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
tooltipTitleTemplate: "<%= label %>",
|
|
140
140
|
|
|
141
141
|
// Number - pixel width of padding around tooltip text
|
|
142
|
-
tooltipYPadding:
|
|
142
|
+
tooltipYPadding: 10,
|
|
143
143
|
|
|
144
144
|
// Number - pixel width of padding around tooltip text
|
|
145
145
|
tooltipXPadding: 10,
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"rgba(255,0,102,1)",
|
|
174
174
|
"rgba(240,35,17,1)",
|
|
175
175
|
"rgba(248,122,9,1)",
|
|
176
|
-
"rgba(
|
|
176
|
+
"rgba(245,200,0,1)",
|
|
177
177
|
"rgba(50,56,64,1)",
|
|
178
178
|
"rgba(126,137,150,1)"
|
|
179
179
|
],
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"rgba(255,0,102,0.1)",
|
|
190
190
|
"rgba(240,35,17,0.1)",
|
|
191
191
|
"rgba(248,122,9,0.1)",
|
|
192
|
-
"rgba(
|
|
192
|
+
"rgba(245,200,0,0.1)",
|
|
193
193
|
"rgba(50,56,64,0.1)",
|
|
194
194
|
"rgba(126,137,150,0.1)"
|
|
195
195
|
],
|
|
@@ -3435,7 +3435,7 @@
|
|
|
3435
3435
|
pointLabelFontStyle : "bold",
|
|
3436
3436
|
|
|
3437
3437
|
//Number - Point label font size in pixels
|
|
3438
|
-
pointLabelFontSize :
|
|
3438
|
+
pointLabelFontSize : 13,
|
|
3439
3439
|
|
|
3440
3440
|
//String - Point label font colour
|
|
3441
3441
|
pointLabelFontColor : "rgba(36,40,46,1)",
|
|
@@ -3739,4 +3739,4 @@
|
|
|
3739
3739
|
|
|
3740
3740
|
});
|
|
3741
3741
|
|
|
3742
|
-
}).call(this);
|
|
3742
|
+
}).call(this);
|
|
@@ -154,7 +154,16 @@ var GMaps = (function(global) {
|
|
|
154
154
|
"use strict";
|
|
155
155
|
|
|
156
156
|
var doc = document;
|
|
157
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Creates a new GMaps instance, including a Google Maps map.
|
|
159
|
+
* @class GMaps
|
|
160
|
+
* @constructs
|
|
161
|
+
* @param {object} options - `options` accepts all the [MapOptions](https://developers.google.com/maps/documentation/javascript/reference#MapOptions) and [events](https://developers.google.com/maps/documentation/javascript/reference#Map) listed in the Google Maps API. Also accepts:
|
|
162
|
+
* * `lat` (number): Latitude of the map's center
|
|
163
|
+
* * `lng` (number): Longitude of the map's center
|
|
164
|
+
* * `el` (string or HTMLElement): container where the map will be rendered
|
|
165
|
+
* * `markerClusterer` (function): A function to create a marker cluster. You can use MarkerClusterer or MarkerClustererPlus.
|
|
166
|
+
*/
|
|
158
167
|
var GMaps = function(options) {
|
|
159
168
|
|
|
160
169
|
if (!(typeof window.google === 'object' && window.google.maps)) {
|
|
@@ -220,6 +229,11 @@ var GMaps = (function(global) {
|
|
|
220
229
|
|
|
221
230
|
if (typeof(options.el) === 'string' || typeof(options.div) === 'string') {
|
|
222
231
|
if (identifier.indexOf("#") > -1) {
|
|
232
|
+
/**
|
|
233
|
+
* Container element
|
|
234
|
+
*
|
|
235
|
+
* @type {HTMLElement}
|
|
236
|
+
*/
|
|
223
237
|
this.el = getElementById(identifier, options.context);
|
|
224
238
|
} else {
|
|
225
239
|
this.el = getElementsByClassName.apply(this, [identifier, options.context]);
|
|
@@ -235,16 +249,61 @@ var GMaps = (function(global) {
|
|
|
235
249
|
window.context_menu = window.context_menu || {};
|
|
236
250
|
window.context_menu[self.el.id] = {};
|
|
237
251
|
|
|
252
|
+
/**
|
|
253
|
+
* Collection of custom controls in the map UI
|
|
254
|
+
*
|
|
255
|
+
* @type {array}
|
|
256
|
+
*/
|
|
238
257
|
this.controls = [];
|
|
258
|
+
/**
|
|
259
|
+
* Collection of map's overlays
|
|
260
|
+
*
|
|
261
|
+
* @type {array}
|
|
262
|
+
*/
|
|
239
263
|
this.overlays = [];
|
|
240
|
-
|
|
241
|
-
|
|
264
|
+
/**
|
|
265
|
+
* Collection of KML/GeoRSS and FusionTable layers
|
|
266
|
+
*
|
|
267
|
+
* @type {array}
|
|
268
|
+
*/
|
|
269
|
+
this.layers = [];
|
|
270
|
+
/**
|
|
271
|
+
* Collection of data layers (See {@link GMaps#addLayer})
|
|
272
|
+
*
|
|
273
|
+
* @type {object}
|
|
274
|
+
*/
|
|
275
|
+
this.singleLayers = {};
|
|
276
|
+
/**
|
|
277
|
+
* Collection of map's markers
|
|
278
|
+
*
|
|
279
|
+
* @type {array}
|
|
280
|
+
*/
|
|
242
281
|
this.markers = [];
|
|
282
|
+
/**
|
|
283
|
+
* Collection of map's lines
|
|
284
|
+
*
|
|
285
|
+
* @type {array}
|
|
286
|
+
*/
|
|
243
287
|
this.polylines = [];
|
|
288
|
+
/**
|
|
289
|
+
* Collection of map's routes requested by {@link GMaps#getRoutes}, {@link GMaps#renderRoute}, {@link GMaps#drawRoute}, {@link GMaps#travelRoute} or {@link GMaps#drawSteppedRoute}
|
|
290
|
+
*
|
|
291
|
+
* @type {array}
|
|
292
|
+
*/
|
|
244
293
|
this.routes = [];
|
|
294
|
+
/**
|
|
295
|
+
* Collection of map's polygons
|
|
296
|
+
*
|
|
297
|
+
* @type {array}
|
|
298
|
+
*/
|
|
245
299
|
this.polygons = [];
|
|
246
300
|
this.infoWindow = null;
|
|
247
301
|
this.overlay_el = null;
|
|
302
|
+
/**
|
|
303
|
+
* Current map's zoom
|
|
304
|
+
*
|
|
305
|
+
* @type {number}
|
|
306
|
+
*/
|
|
248
307
|
this.zoom = options.zoom;
|
|
249
308
|
this.registered_events = {};
|
|
250
309
|
|
|
@@ -271,9 +330,19 @@ var GMaps = (function(global) {
|
|
|
271
330
|
delete map_options[events_that_doesnt_hide_context_menu[i]];
|
|
272
331
|
}
|
|
273
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Google Maps map instance
|
|
335
|
+
*
|
|
336
|
+
* @type {google.maps.Map}
|
|
337
|
+
*/
|
|
274
338
|
this.map = new google.maps.Map(this.el, map_options);
|
|
275
339
|
|
|
276
340
|
if (markerClustererFunction) {
|
|
341
|
+
/**
|
|
342
|
+
* Marker Clusterer instance
|
|
343
|
+
*
|
|
344
|
+
* @type {object}
|
|
345
|
+
*/
|
|
277
346
|
this.markerClusterer = markerClustererFunction.apply(this, [this.map]);
|
|
278
347
|
}
|
|
279
348
|
|
|
@@ -350,6 +419,16 @@ var GMaps = (function(global) {
|
|
|
350
419
|
}, 0);
|
|
351
420
|
};
|
|
352
421
|
|
|
422
|
+
/**
|
|
423
|
+
* Add a context menu for a map or a marker.
|
|
424
|
+
*
|
|
425
|
+
* @param {object} options - The `options` object should contain:
|
|
426
|
+
* * `control` (string): Kind of control the context menu will be attached. Can be "map" or "marker".
|
|
427
|
+
* * `options` (array): A collection of context menu items:
|
|
428
|
+
* * `title` (string): Item's title shown in the context menu.
|
|
429
|
+
* * `name` (string): Item's identifier.
|
|
430
|
+
* * `action` (function): Function triggered after selecting the context menu item.
|
|
431
|
+
*/
|
|
353
432
|
this.setContextMenu = function(options) {
|
|
354
433
|
window.context_menu[self.el.id][options.control] = {};
|
|
355
434
|
|
|
@@ -391,6 +470,9 @@ var GMaps = (function(global) {
|
|
|
391
470
|
}, false);
|
|
392
471
|
};
|
|
393
472
|
|
|
473
|
+
/**
|
|
474
|
+
* Hide the current context menu
|
|
475
|
+
*/
|
|
394
476
|
this.hideContextMenu = function() {
|
|
395
477
|
var context_menu_element = getElementById('gmaps_context_menu');
|
|
396
478
|
|
|
@@ -440,10 +522,16 @@ var GMaps = (function(global) {
|
|
|
440
522
|
}
|
|
441
523
|
});
|
|
442
524
|
|
|
525
|
+
/**
|
|
526
|
+
* Trigger a `resize` event, useful if you need to repaint the current map (for changes in the viewport or display / hide actions).
|
|
527
|
+
*/
|
|
443
528
|
this.refresh = function() {
|
|
444
529
|
google.maps.event.trigger(this.map, 'resize');
|
|
445
530
|
};
|
|
446
531
|
|
|
532
|
+
/**
|
|
533
|
+
* Adjust the map zoom to include all the markers added in the map.
|
|
534
|
+
*/
|
|
447
535
|
this.fitZoom = function() {
|
|
448
536
|
var latLngs = [],
|
|
449
537
|
markers_length = this.markers.length,
|
|
@@ -458,6 +546,11 @@ var GMaps = (function(global) {
|
|
|
458
546
|
this.fitLatLngBounds(latLngs);
|
|
459
547
|
};
|
|
460
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Adjust the map zoom to include all the coordinates in the `latLngs` array.
|
|
551
|
+
*
|
|
552
|
+
* @param {array} latLngs - Collection of `google.maps.LatLng` objects.
|
|
553
|
+
*/
|
|
461
554
|
this.fitLatLngBounds = function(latLngs) {
|
|
462
555
|
var total = latLngs.length,
|
|
463
556
|
bounds = new google.maps.LatLngBounds(),
|
|
@@ -470,6 +563,13 @@ var GMaps = (function(global) {
|
|
|
470
563
|
this.map.fitBounds(bounds);
|
|
471
564
|
};
|
|
472
565
|
|
|
566
|
+
/**
|
|
567
|
+
* Center the map using the `lat` and `lng` coordinates.
|
|
568
|
+
*
|
|
569
|
+
* @param {number} lat - Latitude of the coordinate.
|
|
570
|
+
* @param {number} lng - Longitude of the coordinate.
|
|
571
|
+
* @param {function} [callback] - Callback that will be executed after the map is centered.
|
|
572
|
+
*/
|
|
473
573
|
this.setCenter = function(lat, lng, callback) {
|
|
474
574
|
this.map.panTo(new google.maps.LatLng(lat, lng));
|
|
475
575
|
|
|
@@ -478,10 +578,20 @@ var GMaps = (function(global) {
|
|
|
478
578
|
}
|
|
479
579
|
};
|
|
480
580
|
|
|
581
|
+
/**
|
|
582
|
+
* Return the HTML element container of the map.
|
|
583
|
+
*
|
|
584
|
+
* @returns {HTMLElement} the element container.
|
|
585
|
+
*/
|
|
481
586
|
this.getElement = function() {
|
|
482
587
|
return this.el;
|
|
483
588
|
};
|
|
484
589
|
|
|
590
|
+
/**
|
|
591
|
+
* Increase the map's zoom.
|
|
592
|
+
*
|
|
593
|
+
* @param {number} [magnitude] - The number of times the map will be zoomed in.
|
|
594
|
+
*/
|
|
485
595
|
this.zoomIn = function(value) {
|
|
486
596
|
value = value || 1;
|
|
487
597
|
|
|
@@ -489,6 +599,11 @@ var GMaps = (function(global) {
|
|
|
489
599
|
this.map.setZoom(this.zoom);
|
|
490
600
|
};
|
|
491
601
|
|
|
602
|
+
/**
|
|
603
|
+
* Decrease the map's zoom.
|
|
604
|
+
*
|
|
605
|
+
* @param {number} [magnitude] - The number of times the map will be zoomed out.
|
|
606
|
+
*/
|
|
492
607
|
this.zoomOut = function(value) {
|
|
493
608
|
value = value || 1;
|
|
494
609
|
|
|
@@ -570,6 +685,19 @@ GMaps.prototype.createControl = function(options) {
|
|
|
570
685
|
return control;
|
|
571
686
|
};
|
|
572
687
|
|
|
688
|
+
/**
|
|
689
|
+
* Add a custom control to the map UI.
|
|
690
|
+
*
|
|
691
|
+
* @param {object} options - The `options` object should contain:
|
|
692
|
+
* * `style` (object): The keys and values of this object should be valid CSS properties and values.
|
|
693
|
+
* * `id` (string): The HTML id for the custom control.
|
|
694
|
+
* * `classes` (string): A string containing all the HTML classes for the custom control.
|
|
695
|
+
* * `content` (string or HTML element): The content of the custom control.
|
|
696
|
+
* * `position` (string): Any valid [`google.maps.ControlPosition`](https://developers.google.com/maps/documentation/javascript/controls#ControlPositioning) value, in lower or upper case.
|
|
697
|
+
* * `events` (object): The keys of this object should be valid DOM events. The values should be functions.
|
|
698
|
+
* * `disableDefaultStyles` (boolean): If false, removes the default styles for the controls like font (family and size), and box shadow.
|
|
699
|
+
* @returns {HTMLElement}
|
|
700
|
+
*/
|
|
573
701
|
GMaps.prototype.addControl = function(options) {
|
|
574
702
|
var control = this.createControl(options);
|
|
575
703
|
|
|
@@ -579,6 +707,12 @@ GMaps.prototype.addControl = function(options) {
|
|
|
579
707
|
return control;
|
|
580
708
|
};
|
|
581
709
|
|
|
710
|
+
/**
|
|
711
|
+
* Remove a control from the map. `control` should be a control returned by `addControl()`.
|
|
712
|
+
*
|
|
713
|
+
* @param {HTMLElement} control - One of the controls returned by `addControl()`.
|
|
714
|
+
* @returns {HTMLElement} the removed control.
|
|
715
|
+
*/
|
|
582
716
|
GMaps.prototype.removeControl = function(control) {
|
|
583
717
|
var position = null,
|
|
584
718
|
i;
|
|
@@ -780,13 +914,13 @@ GMaps.prototype.removeMarkers = function (collection) {
|
|
|
780
914
|
var marker = this.markers[i];
|
|
781
915
|
marker.setMap(null);
|
|
782
916
|
|
|
783
|
-
if(this.markerClusterer) {
|
|
784
|
-
this.markerClusterer.removeMarker(marker);
|
|
785
|
-
}
|
|
786
|
-
|
|
787
917
|
GMaps.fire('marker_removed', marker, this);
|
|
788
918
|
}
|
|
789
919
|
|
|
920
|
+
if(this.markerClusterer && this.markerClusterer.clearMarkers) {
|
|
921
|
+
this.markerClusterer.clearMarkers();
|
|
922
|
+
}
|
|
923
|
+
|
|
790
924
|
this.markers = new_markers;
|
|
791
925
|
}
|
|
792
926
|
else {
|
|
@@ -1358,18 +1492,19 @@ GMaps.prototype.getRoutes = function(options) {
|
|
|
1358
1492
|
delete request_options.error;
|
|
1359
1493
|
|
|
1360
1494
|
var self = this,
|
|
1495
|
+
routes = [],
|
|
1361
1496
|
service = new google.maps.DirectionsService();
|
|
1362
1497
|
|
|
1363
1498
|
service.route(request_options, function(result, status) {
|
|
1364
1499
|
if (status === google.maps.DirectionsStatus.OK) {
|
|
1365
1500
|
for (var r in result.routes) {
|
|
1366
1501
|
if (result.routes.hasOwnProperty(r)) {
|
|
1367
|
-
|
|
1502
|
+
routes.push(result.routes[r]);
|
|
1368
1503
|
}
|
|
1369
1504
|
}
|
|
1370
1505
|
|
|
1371
1506
|
if (options.callback) {
|
|
1372
|
-
options.callback(
|
|
1507
|
+
options.callback(routes, result, status);
|
|
1373
1508
|
}
|
|
1374
1509
|
}
|
|
1375
1510
|
else {
|
|
@@ -2205,6 +2340,10 @@ if (typeof window.google === 'object' && window.google.maps) {
|
|
|
2205
2340
|
};
|
|
2206
2341
|
}
|
|
2207
2342
|
|
|
2343
|
+
google.maps.Rectangle.prototype.containsLatLng = function(latLng) {
|
|
2344
|
+
return this.getBounds().contains(latLng);
|
|
2345
|
+
};
|
|
2346
|
+
|
|
2208
2347
|
google.maps.LatLngBounds.prototype.containsLatLng = function(latLng) {
|
|
2209
2348
|
return this.contains(latLng);
|
|
2210
2349
|
};
|
|
@@ -2259,4 +2398,4 @@ if (!Array.prototype.indexOf) {
|
|
|
2259
2398
|
}
|
|
2260
2399
|
|
|
2261
2400
|
return GMaps;
|
|
2262
|
-
}));
|
|
2401
|
+
}));
|