also meine karte könnte ihr leider nicht sehen da man nur mittels vpn auf den uni server kommt
meine code für die karte schaut wie folgt aus
<html>
<head>
<!-- OpenLayers core js -->
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<!-- OpenStreetMap base layer js -->
<script
src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js">
</script>
<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us">
</script>
<script type="text/javascript">
var map, selectControl, selectedFeature;
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
}
function onFeatureSelect(feature) {
selectedFeature = feature;
var tags = feature.attributes;
var infoHtml = "<table>";
for (var key in tags) {
infoHtml += "<tr><td>" + tags[key] + "</td></tr>";
}
infoHtml += "</table>";
popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(),
null,
infoHtml,
null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
function onFeatureUnselect(feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
function init() {
//set up projections
// World Geodetic System 1984 projection
var WGS84 = new OpenLayers.Projection("EPSG:4326");
// WGS84 Google Mercator projection
var WGS84_google_mercator = new OpenLayers.Projection("EPSG:900913");
//Initialize the map
//creates a new openlayers map in the <div> html element id map
map = new OpenLayers.Map ("map", {
controls:[
//allows the user pan ability
new OpenLayers.Control.Navigation(),
//displays the pan/zoom tools
new OpenLayers.Control.PanZoom(),
//displays a layer switcher
new OpenLayers.Control.LayerSwitcher(),
//displays the mouse position's coordinates in a <div> html element with
new OpenLayers.Control.MousePosition({
div:document.getElementById("coordinates")
})
],
projection: WGS84_google_mercator,
displayProjection: WGS84
} );
//base layers
var apiKey = "Ap3i15CGW7YGzZCAkHqKmf3pVxGwDTAd0NLywcxTH3g71vWW1GgLqcD56B_deegZ";
var road = new OpenLayers.Layer.Bing({
name: "Road",
key: apiKey,
type: "Road",
sphericalMercator: true
});
var stmk = new OpenLayers.Layer.WMS( "stmk", "http://129.27.89.66/cgi-bin/mapserv?",
{ map: "F:/ms4w/Apache/htdocs/student/master_geom/hp/map.map", layers: "stmk", transparent: "true"},
{
isBaseLayer: false,
sphericalMercator: true,
singleTile: true,
opacity:0.8
});
var offen = new OpenLayers.Layer.Vector("offen", {
projection: new OpenLayers.Projection("EPSG:4326"),
isBaseLayer: false,
opacity:0.8,
strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1.1})],
protocol: new OpenLayers.Protocol.HTTP({
url: "offen.php",
format: new OpenLayers.Format.Text()
})
});
var pois = new OpenLayers.Layer.Vector("POIs", {
projection: new OpenLayers.Projection("EPSG:4326"),
isBaseLayer: false,
opacity:0.8,
strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1.1})],
protocol: new OpenLayers.Protocol.HTTP({
url: "allebetriebe.php",
format: new OpenLayers.Format.Text()
})
});
map.addLayers([road, stmk, offen, pois]);
var options = { hover: false, onSelect: onFeatureSelect, onUnselect: onFeatureUnselect };
selectControl = new OpenLayers.Control.SelectFeature([pois,offen], options);
map.addControl(selectControl);
selectControl.activate();
// map extent
var mapextent = new OpenLayers.Bounds(15.39633, 46.61470, 15.56113, 46.72708).transform(WGS84, map.getProjectionObject());
map.zoomToExtent(mapextent);
// Interaction; not needed for initial display.
}
</script>
</head>
<body onload="init()">
<div id="map" style="width:700px; height:700px;"></div>
<div id="coordinates"></div>
</body>
</html>[quote=Dennis[B]]Klick einfach mal in der Mapnikkarte auf "Permalink". Dann bekommst Du Links in dieser Art:
http://www.openstreetmap.org/?lat=47.67 … 8&layers=M[/quote]
ich les aber meine daten aus meiner eigenen datenbank aus darin sind auch die koordinaten verspeichert daher müsste ich irgendwie die verspeicherten koordinaten an die karte weitergeben