Commit ec063499 authored by Marin's avatar Marin
Browse files

Accept a DOM element, rather than an element ID string, for initializing the...

Accept a DOM element, rather than an element ID string, for initializing the map (useful when using shadow DOM elements)
parent b93b878f
......@@ -35,7 +35,7 @@ var Spinner = require("./Spinner");
*/
/**
* Main view
* @param divId The placeholder ID in DOM
* @param divId The placeholder ID in DOM (or alternatively, a DOM node)
* @param mode The view mode (basic or advanced)
* @param config The configuration file as an Object
* @param rulesets An array of rulesets defining map styles
......@@ -52,7 +52,7 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
this.mode = (mode == "advanced") ? mode : "basic";
/** The main view DOM **/
this.dom = $("#"+divId);
this.dom = (typeof divId == 'string') ? $("#"+divId) : $(divId);
/** The leaflet map **/
this.map = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment