MapQuery currently suffers from a little complexity, seen in the following api.
<div>var map = $('#map').geoMap();</div><div>var mapData = map.data('geoMap');</div><div><br></div><div>I merged some code that eliminated this by having $("#map").geoMap() return the map object instead of the jQuery collection. This may be counterintuitive to others that are normally used to chaining method calls in jQuery.</div>
<div><br></div><div>I propose the following solution</div><div><br></div><div>$.geoMap([jQuery selector], [options]); //return reference to Object containing all all relevant methods</div><div><br></div><div>The following type of usage would be available:</div>
<div>var map = $.geoMap("#map", {</div><div> layers: [</div><div> { url: '<a href="http://wms">http://wms</a>',</div><div> type: 'wms',</div><div> layers: [states,countries] } ],</div>
<div> transparent: true //apply to all layers,</div><div> ...</div><div> Other options</div><div> ...</div><div>});</div><div><br></div><div>The then have the option of doing two things, either using $.geoMap("#map") to add new controls and/or layers OR $.geoMap returns an object which has these methods available.</div>
<div><br></div><div>$.geoMap("#map", {transparent: false }); is the same as map.transparent( false )</div><div><br></div><div>Ideas for this usage are based on past experiences with $.flot <a href="http://people.iola.dk/olau/flot/API.txt">http://people.iola.dk/olau/flot/API.txt</a></div>
<div><br></div><div>-Drew</div><meta http-equiv="content-type" content="text/html; charset=utf-8">