Overview Examples Documentation Download

image

Extends layer, dispatch.
url

po.image()
Constructs a new image layer with default settings.
image.url([x])

Sets or gets the URL template associated with this image layer. If the argument x is specified, this method sets the URL template and returns this. If no arguments are specified, this method returns the current URL template. The default URL template is “about:blank”.

The URL template may be specified either as a string or as a function:

If a string, and the string contains placeholders of the form “{A}”, where A is any character, then the string is converted into a URL template function using po.url. If the string does not contain placeholders, then it is left as a string and the same image is loaded for each tile without using the request queue.

If a function, then the given function is invoked, passing in the tile coordinate of the image to load. The tile coordinate is represented as an object with row, column and zoom attributes. The function must return a string representing the URL to load. See po.url for an example implementation.

Polymaps is a project from SimpleGeo and Stamen.