GSRasterImage
Represents a raster image feature.
var layer = myMap.createLayer("raster");
// Create the callback for constructing the image URL
var func = function(zoomLevel, bounds, dimension) {
return "http://foo/my-image-webservice?zoomLevel=" + zoomLevel + "&minx=" + bounds.minX +
"&miny=" + bounds.minY + "&maxx=" + bounds.maxX + "&maxy=" + bounds.maxY +
"&width=" + dimension.width + "&height=" + dimension.height;
}
var feature = new GSRasterImageFeature(func);
layer.addFeature(feature);
| Constructor Summary |
GSRasterImageFeature (callback) Creates a new GSRasterImageFeature that is initialized with the properties specified in the params associative array. |
| Method Summary |
| void | setVisible(<boolean> visible) Sets the visibility of this feature |
GSRasterImageFeature(callback)
Creates a new GSRasterImageFeature that is initialized with the properties specified in the params associative array. The raster image feature can be used for overlaying raster images served from a web service. The raster image feature listens to map change events. When such an event occurs (eg. the map has been moved) a user provided callback is fired off with the extent and zoom level of the map as
-
-
- zoomLevel - (int) the current zoom level
- bounds - (GSBounds) the bounds of the current map
- dimension - (GSDimension) the pixel width and height of the map
a - callback function for creating the URL for the overlayed image. The callback must accept these parameters
Parameters:
void
setVisible(<boolean> visible)
Sets the visibility of this feature
-
visible - true if this feature should be visible on the map
Parameters: