Add image to openlayers map

前端 未结 1 1605
悲&欢浪女
悲&欢浪女 2021-01-18 20:27

Here is my code for adding a image on openlayers map.

var image = new OpenLayers.Layer.Image(
    \'Image 1\',
    \'h         


        
相关标签:
1条回答
  • 2021-01-18 21:08

    i have tried following code and it has worked. check out from fiddle. dont forget to select Image layer from layerswitcher.

    var osm = new OpenLayers.Layer.OSM();
    
    var graphic = new OpenLayers.Layer.Image(
        'Image',
        'http://belocalat.com/wp-content/plugins/openlayers/data/baselayer-img1.png',
        new OpenLayers.Bounds(27.418100,35.771100,28.388000,36.558500),
        new OpenLayers.Size(800,255),
        {numZoomLevels: 3}
    );
    
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.addLayers([osm, graphic]);
    map.zoomToExtent(new OpenLayers.Bounds(27.418100,35.771100,28.388000,36.558500));
    

    i hope it helps you...

    0 讨论(0)
提交回复
热议问题