Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I plot an image on OpenLayers, it looks like that image is stretched a little bit as compared to Google Maps. I was wondering if it is normal or there is something wrong with my code.

OpenLayers: enter image description here

Google Maps ( enter image description here

Following is the XML :

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="">
    <name>Ground Overlays</name>
    <description>Examples of ground overlays</description>
      <name>Large-scale overlay on terrain</name>
      <description>Overlay shows Mount Etna erupting 
          on July 13th, 2001.</description>


And following is my JavaScript code:

xml=jQuery.parseXML(oRequest.responseText)  //oRequest.responseText contains above xml


    jQuery.each(groundOverlays,function(index, value){
        var groundOverlay=new Object();


        var options = {   
            'opacity': 1.0, 
            'isBaseLayer': false,
            numZoomLevels : 20 ,

        var image = new OpenLayers.Layer.Image(
            new OpenLayers.Bounds( groundOverlay.west, groundOverlay.south,  groundOverlay.east, groundOverlay.north),
            new OpenLayers.Size(1, 1),


share|improve this question
up vote 2 down vote accepted

Spherical Mercator Projection is used for Google Maps API/Bing Map API.

One of the reasons that the Spherical Mercator projection is so important is that it is the only projection which will allow for overlaying image data on top of commercial layers like Google Maps correctly. When using raster images, in the browser, it is not possible to reproject the images in the same way it might be in a ‘thick’ GIS client. Instead, all images must be in the same projection.

How to create Spherical Mercator projected tiles depends on the software you are using to generate your images. MapServer is a possible route.

(See Creating Spherical Mercator Raster Images)

share|improve this answer

If you look closely, the map itself is also streched, so the image is displayed correctly related to the geographic coordinates in both maps.

share|improve this answer
Yes. You are right. Maps are itself stretched. Did not notice it before, thanks for pointing it out! I guess, this is because of different projects. – Ajinkya Kulkarni Nov 15 '11 at 17:25
If you look at the sea-lines you will see that the maps fits the image overlays perfectly, so It's really nothing wrong here. – awe Nov 16 '11 at 8:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.