Сообщение: Недопустимый аргумент.
Строка: 1176
Символ: 1
Код: 0
URI-код: file:///D:/testmaps/OpenLayers.js
Проверял сам файл KML и POI на доступность качаются, те ссылки не битые.
Сама страница
Код: Выделить всё
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml>"
<head>
<title>VNovgorod</title>
<meta http-equiv='imagetoolbar' content='no'/>
<style type="text/css">
v\:* {behavior:url(#default#VML);}
html, body { overflow: hidden; padding: 0; height: 100%; width: 100%; font-family: 'Lucida Grande',Geneva,Arial,Verdana,sans-serif; }
body { margin: 10px; background: #fff; }
h1 { margin: 0; padding: 6px; border:0; font-size: 20pt; }
#header { height: 43px; padding: 0; background-color: #eee; border: 1px solid #888; }
#subheader { height: 12px; text-align: right; font-size: 10px; color: #555;}
#map { height: 95%; border: 1px solid #888; }
</style>
<script src="OpenLayers.js" type="text/javascript"></script>
<script type="text/javascript">
var map, select;
var mapBounds = new OpenLayers.Bounds( 31.2159529888, 58.4536484488, 31.3524874634, 58.6543265514);
function init(){
var options = {
controls: [new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.KeyboardDefaults()],
maxExtent: new OpenLayers.Bounds( 31.2159529888, 58.4536484488, 31.3524874634, 58.6543265514 ),
maxResolution: 0.000810,
numZoomLevels: 7
};
map = new OpenLayers.Map('map', options);
var layer = new OpenLayers.Layer.TMS( "TMS Layer","", {url:'', serviceVersion:'.', layername:'.', alpha:true, type:'png', getURL:overlay_getTileURL });
map.addLayer(layer);
var layerPOI = new OpenLayers.Layer.Vector("POIs", {
strategies : [new OpenLayers.Strategy.BBOX({resFactor: 1.1})],
protocol : new OpenLayers.Protocol.HTTP({
url : "textfile.txt",
format : new OpenLayers.Format.Text()
})
});
map.addLayer(layerPOI);
selectControl = new OpenLayers.Control.SelectFeature(layerPOI);
map.addControl(selectControl);
selectControl.activate();
layerPOI.events.on({
'featureselected' : onFeatureSelect,
'featureunselected' : onFeatureUnselect
});//*/
map.zoomToExtent( mapBounds );
}
function onPopupClose(evt) {
// 'this' is the popup.
selectControl.unselect(this.feature);
}
function onFeatureSelect(evt) {
feature = evt.feature;
popup = new OpenLayers.Popup.FramedCloud("featurePopup",
feature.geometry.getBounds().getCenterLonLat(),
new OpenLayers.Size(100,100),
"<h2>"+feature.attributes.title + "</h2>" +
feature.attributes.description,
null, true, onPopupClose);
feature.popup = popup;
popup.feature = feature;
map.addPopup(popup);
}
function onFeatureUnselect(evt) {
feature = evt.feature;
if (feature.popup) {
popup.feature = null;
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
}
function overlay_getTileURL(bounds) {
var res = this.map.getResolution();
var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
var y = Math.round((bounds.bottom - this.maxExtent.bottom) / (res * this.tileSize.h));
var z = this.map.getZoom();
if (x >= 0 && y >= 0) {
return this.url + z + "/" + x + "/" + y + "." + this.type;
} else {
return "none.png";
}
}
</script>
</head>
<body onload="init()">
<div id="map" class="smallmap"></div>
</body>
</html>
Код: Выделить всё
point title description icon
31.26640,58.50640 my orange title my orange description http://www.openlayers.org/api/img/zoom-world-mini.png