1 var WGS84 = new OpenLayers.Projection("EPSG:4326");
2 var Mercator = new OpenLayers.Projection("EPSG:900913");
5 view: new OpenLayers.StyleMap({
6 "default": new OpenLayers.Style({
14 function resizeMap() {
15 var map = document.getElementById('map');
16 map.style.width = map.offsetWidth.toString() + 'px';
17 map.style.height = map.offsetHeight.toString() + 'px';
21 var map = new OpenLayers.Map('map', {
22 controls: [ new OpenLayers.Control.Attribution() ],
25 baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }),
27 layerOptions = {format: OpenLayers.Format.WKT,
29 styleMap: styleMap.view,
30 attribution: SyjStrings.geomAttribution },
32 viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions),
33 wkt = new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 });
35 map.addLayers([baseLayer, viewLayer]);
36 viewLayer.addFeatures([wkt.read(gInitialGeom.data)]);
37 extent = viewLayer.getDataExtent();
39 map.zoomToExtent(extent);
43 window.onresize = function() {
47 if (window.addEventListener) {
48 window.addEventListener("load", init, false);
50 window.attachEvent("onload", init);