var markers;
var popup;
-function createMap(divName) {
- map = new OpenLayers.Map(divName,
- { maxExtent: new OpenLayers.Bounds(-20037508,-20037508,20037508,20037508),
- maxResolution: 156543,
- units: 'm',
- projection: "EPSG:41001" });
+OpenLayers._getScriptLocation = function () {
+ return "/openlayers/";
+}
- var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", { displayOutsideMaxExtent: true });
+function createMap(divName) {
+ map = new OpenLayers.Map(divName, {
+ controls: [
+ new OpenLayers.Control.ArgParser(),
+ new OpenLayers.Control.Attribution(),
+ new OpenLayers.Control.LayerSwitcher(),
+ new OpenLayers.Control.Navigation(),
+ new OpenLayers.Control.PanZoomBar(),
+ new OpenLayers.Control.ScaleLine()
+ ],
+ units: "m"
+ });
+
+ var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
+ displayOutsideMaxExtent: true,
+ wrapDateLine: true
+ });
map.addLayer(mapnik);
- var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", { displayOutsideMaxExtent: true });
+ var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
+ displayOutsideMaxExtent: true,
+ wrapDateLine: true
+ });
map.addLayer(osmarender);
- markers = new OpenLayers.Layer.Markers("markers", { visibility: false });
+ var maplint = new OpenLayers.Layer.OSM.Maplint("Maplint", {
+ displayOutsideMaxExtent: true,
+ wrapDateLine: true
+ });
+ map.addLayer(maplint);
+
+ var numZoomLevels = Math.max(mapnik.numZoomLevels, osmarender.numZoomLevels);
+ markers = new OpenLayers.Layer.Markers("Markers", {
+ displayInLayerSwitcher: false,
+ numZoomLevels: numZoomLevels,
+ maxExtent: new OpenLayers.Bounds(-20037508,-20037508,20037508,20037508),
+ maxResolution: 156543,
+ units: "m",
+ projection: "EPSG:900913"
+ });
map.addLayer(markers);
- map.addControl(new OpenLayers.Control.LayerSwitcher());
- map.addControl(new OpenLayers.Control.KeyboardDefaults());
-
return map;
}
var marker = new OpenLayers.Marker(position, icon);
markers.addMarker(marker);
- markers.setVisibility(true);
if (description) {
marker.events.register("click", marker, function() { openMapPopup(marker, description) });