I'm having trouble with OpenLayers. My working code is:
<html><body>
<div id="mapdiv"></div>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script>
map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer.OSM());
//var results = new OpenLayers.Layer.Text("My Points", { location:"./checkIns_0_view.txt", projection: map.displayProjection});
//map.addLayer(results);
var query = new OpenLayers.LonLat(-122.2928337167, 37.5549570333).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
var markers = new OpenLayers.Layer.Markers("Markers");
map.addLayer(markers);
var size = new OpenLayers.Size(21,25);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var icon = new OpenLayers.Icon('http://openlayers.org/dev/img/marker-blue.png', size, offset);
marker = new OpenLayers.Marker(query, icon);
markers.addMarker(marker);
var zoom=16;
map.setCenter (query, zoom);
</script>
</body></html>
Now I want to add a Popup with some informations. I tried using several examples, like http://openlayers.org/dev/examples/osm-marker-popup.html. I want to add something like this:
var popup = new OpenLayers.Popup.FramedCloud("Popup", query, null, "Text", true);
map.addPopup(popup);
The first line can be compiled, but when I add the second line, the browser doesn't show my map. I think it might have to do with the query-lonLat, but I doesn't have the necessary OpenLayers-skills to find out.
I would appreciate an answer very much.
Greetings