The code works in Chrome but doesnt work in IE or Mozilla..weird...
I was fooling around with Mapstraction (http://www.mapstraction.com/)
Just take a look please...
HTML Code:<html> <head> <title>OpenStreetMap</title> <!-- HTML Map element - the size must be specified here, or in the CSS --> <div id="mapstraction" style="width:100%; height:100%"></div> <!-- Map Provider & Mapstraction Javascript includes --> <script src="http://www.openlayers.org/api/OpenLayers.js"></script> <script type="text/javascript" src="http://mapstraction.com/src/mapstraction.js"></script> <script type="text/javascript"> // initialise the map with your choice of API var mapstraction = new Mapstraction('mapstraction','openlayers'); // create a lat/lon object var myPoint = new LatLonPoint(34.4041960114344,-83.5); // display the map centered on a latitude and longitude (Google zoom levels) mapstraction.setCenterAndZoom(myPoint, 10); mapstraction.addControls({ pan: true, zoom: 'small', map_type: true }); // create a marker positioned at a lat/lon my_marker = new Marker(myPoint); my_marker.setIcon('http://boston.openguides.org/markers/BLUE.png'); mapstraction.addMarker( new Marker( new LatLonPoint(34.504,-83.008))); var text = "<b>Atlanta</b>"; // add info bubble to the marker my_marker.setInfoBubble(text); // display marker mapstraction.addMarker(my_marker); // open the marker my_marker.openBubble(); mapstraction.addEventListener('click', function(p) { alert('Mapstraction Event Handling - Mouse clicked at ' + p) }); ufoo = function() { mapstraction.removeMarker(my_marker); } </script> </body> </html>


Reply With Quote
Bookmarks