3 var WGS84 = new OpenLayers.Projection("EPSG:4326");
4 var Mercator = new OpenLayers.Projection("EPSG:900913");
7 view: new OpenLayers.StyleMap({
8 "default": new OpenLayers.Style({
16 function resizeMap() {
17 var map = document.getElementById('map');
18 map.style.width = map.offsetWidth.toString() + 'px';
19 map.style.height = map.offsetHeight.toString() + 'px';
23 var map = new OpenLayers.Map('map', {
25 new OpenLayers.Control.Navigation(),
26 new OpenLayers.Control.Attribution()
30 baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }),
32 layerOptions = {format: OpenLayers.Format.WKT,
34 styleMap: styleMap.view,
35 attribution: SyjStrings.geomAttribution },
37 viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions),
38 wkt = new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 });
40 map.addLayers([baseLayer, viewLayer]);
41 viewLayer.addFeatures([wkt.read(gInitialGeom.data)]);
42 var extent = viewLayer.getDataExtent();
44 map.zoomToExtent(extent);
48 window.onresize = function() {
52 if (window.addEventListener) {
53 window.addEventListener("load", init, false);
55 window.attachEvent("onload", init);