var map, layer;
function init(){
<script src='http
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://mapsvmap0.googletiles.comosgeo.org/maps?file=api&v=2&key=ABQIAAAAl9RMqSzhPUXAfeBCXOussRTQDbvAygy0cfGJr8dEMAYKf3RWNBQqP9mjKIsqTfmAlz5LOJ3Xpy5s4w'><wms/script>
vmap0", {layers: <script'basic'} type="text/javascript">);
// Add Styles
var lonmyStyles = 5;new OpenLayers.StyleMap({
var lat = 40; "default": new OpenLayers.Style({
var zoom = 5; fillColor: "#000",
var map fillOpacity: 0.3,
layer; strokeColor: "#000",
strokeOpacity: 0.3,
strokeWidth: 1,
function init(){ graphicZIndex: 1
layer}),
= "select": new OpenLayers.Layer.WMSStyle({
"OpenLayers WMS" fillColor: "#ccc",
fillOpacity: 0.6,
"http strokeColor://vmap0.tiles.osgeo.org/wms/vmap0" "#ccc",
{layers strokeWidth: 'basic'}1,
); label: "Label for Mouseover",
labelAlign: "cc",
fontColor: "#333333",
fontOpacity: 0.9,
fontFamily: "Arial",
fontSize: 14,
graphicZIndex: 2
})
});
vlayer = new OpenLayers.Layer.Vector( "Editable",{
styleMap: myStyles,
rendererOptions: {zIndexing: true}
});
map = new OpenLayers.Map( 'map', {
// Add Openlayers Map Controls
controls:
[
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.EditingToolbar(vlayer)
]
});
// Make Variables for Google Version 3
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN}
);
var gmap = new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20}
);
var ghyb = new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
);
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
);
// Add layerlayers to map
map.addLayeraddLayers([gphy, gmap, ghyb, gsat]);
map.addLayers([layer, vlayer]);
// Google.v3 uses EPSG:900913 as projection, so we have to transform our coordinates
map.setCenter(new OpenLayers.LonLat(lon10.2, lat48.9).transform(
new OpenLayers.Projection("EPSG:4326"),
zoom map.getProjectionObject();
), 5);
var panel = new OpenLayers.Control.Panel();
panel.addControls([
new OpenLayers.Control.Button({
displayClass: "helpButton", trigger: function() {alert('help')}, title: 'Help'
})
]);
</script> map.addControl(panel);