[OpenLayers-Users] controls missing, and scale,
permalink etc misplaced
Jan Martin
janmartin3 at googlemail.com
Tue Jun 9 14:09:09 EDT 2009
Hi,
I think the controls belong to the
map = new OpenLayers.Map('map', options);
line. Instead you only have the word "options".
Replace it with the controls.
Check out my map on how to do so:
http://mybestprojects.com/data/test4/test4.html
Read this:
http://n2.nabble.com/Going-nuts:-getDataExtent-td3042554.html
If you find out how to make the map zoom in on the largest track, instead of
the last on added, let me know.
Jan
On Tue, Jun 9, 2009 at 7:27 PM, Nicholas Efremov-Kendall <
n.e.kendall at gmail.com> wrote:
>
> 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);
> }
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090609/70ea21e9/attachment.html
More information about the Users
mailing list