Articles and Tutorials

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

Constructor Detail

GSRasterImageFeature

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
  •  
    •  
      1. zoomLevel - (int) the current zoom level
      2. bounds - (GSBounds) the bounds of the current map
      3. 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:
Method Detail

setVisible

void setVisible(<boolean> visible)
    Sets the visibility of this feature
  •  
      visible - true if this feature should be visible on the map
  • Parameters: