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', {
23 new OpenLayers.Control.Navigation(),
24 new OpenLayers.Control.Attribution()
28 baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }),
30 layerOptions = {format: OpenLayers.Format.WKT,
32 styleMap: styleMap.view,
33 attribution: SyjStrings.geomAttribution },
35 viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions),
36 wkt = new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 });
38 map.addLayers([baseLayer, viewLayer]);
39 viewLayer.addFeatures([wkt.read(gInitialGeom.data)]);
40 extent = viewLayer.getDataExtent();
42 map.zoomToExtent(extent);
46 window.onresize = function() {
50 if (window.addEventListener) {
51 window.addEventListener("load", init, false);
53 window.attachEvent("onload", init);