Adding WMS Layer Leaflet Trouble

المشرف العام

Administrator
طاقم الإدارة
The Problem:

I'm pretty new to leaflet and I'm trying to add a outline of the states over my OSM layer via WMS. I've found several tutorials online, some directly from the leaflet website but haven't had any success.

My code:

var map; var feature; function load_map() { map = new L.Map('map', {zoomControl: true}); var osmUrl = 'http:///osm_tiles/{z}/{x}/{y}.png', osmAttribution = 'Map data © 2012 OpenStreetMap contributors', osm = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: osmAttribution}); map.setView(new L.LatLng(0, 0), 3).addLayer(osm); var states = L.tileLayer.wms('http://:8080/geoserver/States/wms', { format: 'img/png', transparent: true, layers: "null" }); states.addTo(map); } window.onload = load_map; When I open the console in google chrome there are no reported errors with my java script or connecting to the server. When the map is displayed it has no problem displaying the OSM layer, but the WMS layer is missing.

Thanks in advance.



أكثر...
 
أعلى