0
我只是試着從例如一些簡單的代碼:創建一個OpenLayers地圖 - 我做錯了什麼?
$(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();
}
});
但Chrome和Firefox不顯示我的地圖,並拋出錯誤:uncaught type error: Cannot call method 'apply' of undefined Openlayers.js:127
其相當有趣,因爲前一段時間這個代碼工作