[OpenLayers-Dev] can't use tiff image

arjun dheer dheer.arjun at gmail.com
Sun Feb 17 17:35:13 EST 2008

I am trying to use a Tiff image for display using openlayers. I tried to use
the following code. This code resembles the one in the
image-layer.htmlexample. The code is as follows:

<html xmlns="http://www.w3.org/1999/xhtml">
      <title>OpenLayers Image Layer Example</title>
    <link rel="stylesheet" href="../theme/default/style.css" type="text/css"
    <style type="text/css">
        p {
            width: 512px;
        #map {
            width: 512px;
            height: 512px;
            border: 1px solid gray;
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map;
        function init(){
            map = new OpenLayers.Map('map');

            var options = {numZoomLevels: 3};

            var graphic = new OpenLayers.Layer.Image(
                                'City Lights',
                               * new OpenLayers.Bounds(-117.065, -32.740, -
117.000, 32.782),*
                                new OpenLayers.Size(5419, 4383),

            var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
                {layers: "landsat7"}, options);

            map.addLayers([graphic, jpl_wms]);
            map.addControl(new OpenLayers.Control.LayerSwitcher());

  <body onload="init()">
    <h1 id="title">Image Layer Example</h1>

    <div id="tags"></div>

    <p id="shortdesc">
        Demonstrate a single non-tiled image as a selectable base layer.

    <div id="map"></div>

    <div id="docs">
            The "City Lights" layer above is created from a single web
            image.  If you construct it without any resolution related
            the layer will be given a single resolution based on the
            Otherwise, it behaves much like a regular layer.  This is
            intended to be used in an overview map - where another layer
            might not make a good overview.

The bounding box values were taken by taking an estimate of the lat long
values using google maps.

The image is not bieng displayed. I have also taken the easting northing
values of the image using ermapper software which are as follows:
left bottom: 637283.68 E
                  1860785.83 N
right top: 6312701.61 E
              1865167.64 N
I have not yet converted these values into latlong values but will do so
once it is confirmed that I am headed in the right direction. Please help me
out as to what should I do to get the image displayed. Following are the
images shored in the htdocs folder. By the way, I am using Apache.
Please help me out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080217/7f26b00c/attachment.html

More information about the Dev mailing list