[OpenLayers-Users] controls missing, and scale, permalink etc misplaced

Nicholas Efremov-Kendall n.e.kendall at gmail.com
Tue Jun 9 13:27:51 EDT 2009


Hi Again,
I've sloppily worked around the issue by just creating another div with the
id 'map,' which at least loads my data into the right place. However, now my
controls are missing (zoom etc) and the permalink, scale, and coordinates
have all been moved to the top left corner. I assume this is a fairly simple
gotcha that I'm over looking...any help and your patience is appreciated.

1) what happened to the controls?
2) why is my scale bar displaying NaM/NaFt (I know this must have to do with
the projection or the lack of one in my gml)
3) why did the permalink, scale, and mouseposition get moved to the topleft
corner?

here's my code
    var lon = 675833.7195;
        var lat = 3740782.6657;
        var zoom = 2;
        var map, layer;
        var options = {
        maxResolution: 'auto',
        maxExtent: new OpenLayers.Bounds(568446.75, 3565307.25, 813860.25,
3781736.25),
        projection: new OpenLayers.Projection("EPSG:22332"),
        units: "meters"
        };

        //Map Creation
   function init(){
           map = new OpenLayers.Map('map', options);
        var topo = new OpenLayers.Layer.GML("Jerba Topography", "topo.gml",
{isBaseLayer: true, styleMap: new OpenLayers.StyleMap({strokeWidth: 1,
strokeColor: "#000000"}) });
         map.addLayer(topo);
         var sites = new OpenLayers.Layer.GML("Sites", "sites.gml",
{styleMap: new OpenLayers.StyleMap({pointRadius: 2.5, fillColor: "#CCCCCC"},
{projection: new OpenLayers.Projection("EPSG:22332 ")})
        });
         map.addLayer(sites);
         map.addControl( new OpenLayers.Control.LayerSwitcher());
            map.addControl( new OpenLayers.Control.MousePosition());
            map.addControl( new OpenLayers.Control.OverviewMap());
            map.addControl( new OpenLayers.Control.ScaleLine());
            map.addControl(new OpenLayers.Control.Permalink());
            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
            }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090609/35485100/attachment.html


More information about the Users mailing list