Creating an OpenLayers map - what am I doing wrong?
I've just tried some simple code from example:
$(document).ready(function() {
   var map = OpenLayers.Map('map-content', {});
   var wms_serever_map = OpenLayers.Layer.WMS('Base l', 'http://vmap0.tiles.osgeo.org/wms/vmap0', {layer:basic},
       {});
   map.addLayer(wms_serever_map);
   if(!map.getCenter()){
      map.zoomToMaxExtent();开发者_JAVA技巧
   }
});
but chrome and firefox don't show me the map and throws error: uncaught type error: Cannot call method 'apply' of undefined Openlayers.js:127 Its rather interesting, because some time ago this code worked
Try adding 'new' keyword infront of OpenLayers.Map and OpenLayers.Layer.WMS and see if it solves the problem.
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论