[MapQuery] starting a widget API is wrong
Volker Mische
volker.mische at gmail.com
Fri Jul 1 07:34:10 EDT 2011
On 07/01/2011 01:11 PM, Steven M. Ottens wrote:
> On 6/30/2011 4:15 PM, Volker Mische wrote:
>> On 06/30/2011 12:05 PM, Anne Blankert wrote:
>>> But until now, the idea of MapQuery is that it modifies the look and
>>> behaviour of DOM elements instead of the look and behaviour of the map
>>> element. For this reason I would stay with
>>> $("domselector").mqWidget(options)
>>> and
>>> $("domselector").mqWidget($("mapselector"))
>>>
> Hi all,
>
> Some more pondering resulted in the conclusion that this is not possible:
>
> $("domselector").mqWidget($("mapselector"))
>
> Because this approach will destroy the options object in the widget. So
> all the default settings as set in the options object in the widget will
> be destroyed as well.
>
> So I'd say the definitive API for widgets is:
> $("domselector").mqWidget({map:"mapselector"})
> I'll update the widgets and examples accordingly.
>
> (I don't like passing in the jQuery object like this:
> $("domselector").mqWidget({map:$("mapselector")}) )
But I think you can still pass in $("mapselector"), can't you?
The "mapselector" will be just evaluated by jQuery. and I think jQuery
can do things like $($("mapselector")).
I'm not really interested in $("mapselector") that much, but rather in
the possibility to pass in a DOM node (which should be possible as well).
Cheers,
Volker
More information about the MapQuery
mailing list