
Tutorial: Adding Raster Data
Raster Layers
You can also add raster layers. The code below will add a single raster from our server. The raster is from the NASA Visible Earth web site
The web only supports "PNG" and "JPG" formats and these formats do not provide georeferencing information. You'll need to specify the bounds of the raster as shown be low. The values can be found in BlueSpray by right clicking on a layer and selecting "Settings". Then, click on the "Extent" tab and copy and paste the extents into the appropriate lines below.
You'll also need to add another include for the "CMLayerRaster.js" file. The California History example shows how to add a raster as a background.
//***************************************************** var Layer_World=new CMLayerRaster(); Layer_World.SetURL("GISData/Rasters/GoogleMercator/world.topo.bathy.200411.3x5400x2700.jpg",TheCanvasMap.GetView()); // change this to where you placed the data Layer_World.SetName("Blue Marble"); var TheBounds = { XMin: -180, XMax: 180, YMin: -90, YMax: 90 } Layer_World.SetBounds(TheBounds); TheCanvasMap.AddLayer(Layer_World);