I am new in web mapping, but I have great interest in it. I would like to ask for your help, I have encountered a problem regarding on applying wms layer into my website(html), here is my code:
I have an OSM base layer. but when I run this the output will only show a pink tile.
I don't know what is wrong or what to do. it would really help me a lot if someone can help me with this. thank you and regards.
oh, here is the code I have edited it, changed the layer into layers, but still the output is the same.
<html>
<head>
<title>OpenLayers Example</title>
<script src="./Javascripts/OpenLayers-2.13.1/OpenLayers.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var osm = new OpenLayers.Layer.OSM();
var dm_wms = new OpenLayers.Layer.WMS(
"zambo_data",
"http://localhost:8080/geoserver/zamboanga/wms",
{
layers: 'zamboanga:zam1',
transparent: 'true',
format:'img/png'
},
{isBaseLayer: false, projection:'ESPG:4326'}
);
map.addLayers([osm,dm_wms]);
map.zoomToMaxExtent();
</script>