Hello everyone,
I am in the process of adding a KML as a baselayer (I was quickly helped by Eric and Christopher by finding the constructor attribute need for this.). Now I seem to have stuck another in relation to projections. I have noticed that if I add the KML as the only base layer it comes out a bit squashed, when if I don't change any projection settings and just add a WMS layer as another base layer it seems to correct the KML. - Unsure if anything is going on behind the scenes (with my KML being reprojected?) or if im just missing something extremely obvious. - Any help would be appreciated. function mapInit() { var nzBounds = new OpenLayers.Bounds(165, -47, 180, -34.5).transform((new OpenLayers.Projection("EPSG:4326")), (new OpenLayers.Projection("EPSG:900913"))); var options = { projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326"), units: "m", maxResolution: 16543.0339, maxExtent: nzBounds, numZoomLevels: 24, minZoomLevel: 6, maxZoomLevel:18, controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.LayerSwitcher({'ascending':false}), new OpenLayers.Control.PanZoomBar({zoomWorldIcon:true}) ] }; map = new OpenLayers.Map('map', options); map.addControl(new OpenLayers.Control.LayerSwitcher()); var mapnik = new OpenLayers.Layer.TMS( "OpenStreetMap (Mapnik)", "http://tile.openstreetmap.org/", { type: 'png', displayOutsideMaxExtent: true, attribution: '<a href="http://www.openstreetmap.org/">OpenStreetMap</a>' } ); mapnik.setVisibility(false); var time = new Date(); var secs = time.getSeconds(); postCodeKml = new OpenLayers.Layer.GML("CoverageTEST", "kml/coverage_1.kml?" + secs, { format: OpenLayers.Format.KML, projection:map.displayProjection, isBaseLayer:true, formatOptions: { extractStyles: true, extractAttributes: true } } ); map.addLayers([mapnik]); postCodeKml.setVisibility(true); map.addLayer(postCodeKml); postCodeKml.setOpacity(0.25); map.zoomToExtent(nzBounds); map.addControl(new OpenLayers.Control.MousePosition());
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users