1 /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
2 and is published under the AGPL license. */
6 var WGS84 = new OpenLayers.Projection("EPSG:4326");
7 var Mercator = new OpenLayers.Projection("EPSG:900913");
10 view: new OpenLayers.StyleMap({
11 "default": new OpenLayers.Style({
19 function resizeMap() {
20 var map = document.getElementById('map');
21 map.style.width = map.offsetWidth.toString() + 'px';
22 map.style.height = map.offsetHeight.toString() + 'px';
26 var map = new OpenLayers.Map('map', {
28 new OpenLayers.Control.Navigation(),
29 new OpenLayers.Control.Attribution()
33 baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }),
35 layerOptions = {format: OpenLayers.Format.WKT,
37 styleMap: styleMap.view,
38 attribution: SyjStrings.geomAttribution },
40 viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions),
41 wkt = new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 });
43 map.addLayers([baseLayer, viewLayer]);
44 viewLayer.addFeatures([wkt.read(gInitialGeom.data)]);
45 var extent = viewLayer.getDataExtent();
47 map.zoomToExtent(extent);
51 window.onresize = function() {
55 if (window.addEventListener) {
56 window.addEventListener("load", init, false);
58 window.attachEvent("onload", init);