admin管理员组文章数量:1335840
Here is my code for adding a image on openlayers map.
var image = new OpenLayers.Layer.Image(
'Image 1',
'.png',
//new OpenLayers.Bounds(27.418100,35.771100,28.388000,36.558500),
new OpenLayers.Size(800,255),
{isBaseLayer: false}
);
map.addLayer(image);
but, i can't display image on openlayers. can anyone give me solution for this ?
Thanks in advance.
Here is my code for adding a image on openlayers map.
var image = new OpenLayers.Layer.Image(
'Image 1',
'http://belocalat./wp-content/plugins/openlayers/data/baselayer-img1.png',
//new OpenLayers.Bounds(27.418100,35.771100,28.388000,36.558500),
new OpenLayers.Size(800,255),
{isBaseLayer: false}
);
map.addLayer(image);
but, i can't display image on openlayers. can anyone give me solution for this ?
Thanks in advance.
Share Improve this question edited Feb 14, 2013 at 13:19 urcm 2,2841 gold badge19 silver badges45 bronze badges asked Feb 13, 2013 at 7:14 TejasTejas 9282 gold badges16 silver badges40 bronze badges 2- why is the line setting bounds mented out? – olly_uk Commented Feb 13, 2013 at 10:56
- if i remove ment it doesn't working.. have you any solution ? – Tejas Commented Feb 14, 2013 at 4:10
1 Answer
Reset to default 3i 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./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...
本文标签: javascriptAdd image to openlayers mapStack Overflow
版权声明:本文标题:javascript - Add image to openlayers map - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742367724a2461625.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论