Skip to content

API for the MapQuery developer

stvno edited this page Jul 4, 2011 · 11 revisions
var mapquery = $(mapselector).data("mapQuery");

functions in MapQuery Core

Map functions

mapquery.goto({position: [x:y], zoom: z<int>, box: [llx,lly,urx,ury]}) (get/set map-extent)  
mapquery.layers({options}) (get/set layers of the map)  
mapquery.layers().remove() (remove all layers)

Layer.options: are flat and official API we have to figure out how to document ALL options
Layer.options.extras for widget developers to add extra properties to options who are not in the API

Note all positions are in epsg:4326 (same as GPS coordinates) and box: [llx,lly,urx,urx] overrules other parameters in goto()

Not implementing:
mapquery.pan() use goto({position: [x,y]})
mapquery.position([x,y]) (go to some specific location) use goto({position: [x,y]})
mapquery.zoom(z<int>) (zoom to a specific zoom level) use goto({zoom: z<int>})
mapquery.resize() Whenever the DOM element the map is in gets resized, the map should automatically follow. To resize the map, resize its DOM element.

Layer functions

layer.remove() (removes a layer)  
layer.up() (move the layer up in the layers stack)  
layers.down() (move the layer down in the layers stack)  
layers.position(<int>) (get/set the position of the layer in the layers stack)  
layers.visible(<boolean>) (get/set the visibility of the layer)  
layers.opacity(<float>) (get/set the opacity of the layer)  

Not implementing:
layer.hide() (use visible(false))
layer.show() (use visible(true))

Low level properties

mapquery.olMap (get the openlayers map object) 
mapquery.element (get the jQuery object)

I18n

Internationalization

templating

see http://wiki.jqueryui.com/w/page/37898666/Template

Themes and styles