|
49 | 49 |
|
50 | 50 | // the global options
|
51 | 51 | self.options = self.extendDefaultOptions(options);
|
52 |
| - |
| 52 | + |
53 | 53 | // Save initial HTML content (used by destroy method)
|
54 | 54 | self.initialHTMLContent = self.$container.html();
|
55 | 55 |
|
|
115 | 115 | * Each mapael object inherits their properties and methods from this prototype
|
116 | 116 | */
|
117 | 117 | Mapael.prototype = {
|
118 |
| - |
| 118 | + |
119 | 119 | /*
|
120 | 120 | * Version number
|
121 |
| - */ |
| 121 | + */ |
122 | 122 | version: version,
|
123 | 123 |
|
124 | 124 | /*
|
|
236 | 236 |
|
237 | 237 | $(self.paper.desc).append(" and Mapael " + self.version + " (http://www.vincentbroute.fr/mapael/)");
|
238 | 238 | },
|
239 |
| - |
| 239 | + |
240 | 240 | /*
|
241 | 241 | * Destroy mapael
|
242 | 242 | * This function effectively detach mapael from the container
|
243 | 243 | * - Set the container back to the way it was before mapael instanciation
|
244 | 244 | * - Remove all data associated to it (memory can then be free'ed by browser)
|
245 |
| - * |
| 245 | + * |
246 | 246 | * This method can be call directly by user:
|
247 | 247 | * $(".mapcontainer").data("mapael").destroy();
|
248 |
| - * |
| 248 | + * |
249 | 249 | * This method is also automatically called if the user try to call mapael
|
250 | 250 | * on a container already containing a mapael instance
|
251 | 251 | */
|
252 |
| - destroy: function() { |
| 252 | + destroy: function () { |
253 | 253 | var self = this;
|
254 | 254 | // Empty the container (this will also detach all event listeners)
|
255 | 255 | self.$container.empty();
|
|
274 | 274 | self.links = undefined;
|
275 | 275 | },
|
276 | 276 |
|
277 |
| - handleMapResizing: function() { |
| 277 | + handleMapResizing: function () { |
278 | 278 | var self = this;
|
279 | 279 | // Create the legends for plots taking into account the scale of the map
|
280 | 280 | var createPlotLegend = function () {
|
281 | 281 | self.createLegends("plot", self.plots, (self.$map.width() / self.mapConf.width));
|
282 | 282 |
|
283 | 283 | self.$map.off("resizeEnd." + pluginName, createPlotLegend);
|
284 | 284 | };
|
285 |
| - |
| 285 | + |
286 | 286 | // onResizeEvent: call when the window element trigger the resize event
|
287 | 287 | // We create it inside this function (and not in the prototype) in order to have a closure
|
288 | 288 | // Otherwise, in the prototype, 'this' when triggered is *not* the mapael object but the global window
|
|
295 | 295 | }, 150);
|
296 | 296 | };
|
297 | 297 |
|
298 |
| - // Attach resize handler |
| 298 | + // Attach resize handler |
299 | 299 | $(window).on("resize." + pluginName, self.onResizeEvent);
|
300 | 300 |
|
301 | 301 | self.$map.on("resizeEnd." + pluginName, function () {
|
|
0 commit comments