[OpenLayers-Users] General Questions

Robert J Becraft castlewrks at hughes.net
Tue Feb 20 17:39:26 EST 2007


> > 1) I have successfully placed the latitude/longitude display on my 
> > map. However, the example I used to do this causes it to appear in
the 
> > lower right hand corner of the map.  I cannot determine why this 
> > happens in the example, and cannot get mine to replicate that
location 
> > for this display.  It will only appear in the upper left-hand corner

> > and conflicts with the directional graphics there.
> 
> It sounds like you're missing the 'theme/' directory. The 
> theme directory includes the CSS which correctly positions 
> some of the controls.
> 
> http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#Whydo
> estheOverviewMapdisplayonthetopleftofthemapandnotinthedefaultposition
> addresses this for the OvervieMap -- the issue is the same.

FIXED!  Great!

> 
> > 2) I need to know "how" to include a tiled image of my personal maps

> > to the code.  All the examples go to map servers that provide that 
> > option for the images.  None of the examples show how to include a
set 
> > of tiled images that I've created.  I am hoping that I do not have
to 
> > create a map server to do this.
> 
> How are your tiles generated now? If you can generate them 
> according to TMS 
> http://wiki.osgeo.org/index.php/Tile_Map_Service_Specification
>  you can use the TMS layer with OL 2.3.
>


Well, right now, it is one 2000x4000 px gif/jpeg.  Is there a tool that
can break that down into tiles and compose the needed files to manage
that?

The Tile Map specification isn't clear as to what I need to do to use it
and interface properly with Open Layers.  I'd like something simple and
since I'm not currently tied into any particular method, my only
requirement is to be able to build a set of tiles that don't require any
special server code.


 
> > 3) Some of the examples create a map from a pre-determined location
on 
> > Earth.  Is there a way of defining a new world?  For example if one 
> > wanted to use OpenLayers to map Mars or the Moon, how would you
define 
> > the latitude/longitude orientation of the maps?
> 
> http://location.highearthorbit.com/space/mars.html is an example.
>

O.K.  Thanks.
 
> > 4) After zooming in on my primary map, it pixelizes and becomes 
> > unreadable.  How do you transition from the primary layer to a new 
> > layer that has higher detail at that zoom level?  A map-server would

> > do this automatically for you.  However, all my maps are generated
by 
> > me and as in #2, I don't want to have to set up a map server to do 
> > this.
> 
> Again, it depends on how you're currently generating your tiles.
> 

Something simple... For #2 would be nice.

> > 5) One anomoly I encountered concerned the box tool and the pan
tool. 
> > Using the published 2.2 code, and clicking on the box tool, when 
> > dragging across the map had both active.  I used the 2.3 code and it

> > appears that a fix is included in that.  HOWEVER, the examples all 
> > have this bug fixed and do not exhibit this problem leading me to 
> > believe that the code they are using isn't 2.2 code like they 
> > indicate.
> 
http://trac.openlayers.org/wiki/DefaultControls is probably helpful.
There is, by default, a mousedefaults control: the mousetoolbar control
is a subclass of this. Including both will probably have the affect you
describe.

This was more an observation than a problem.  Thanks.

> 6) Is it possible to include a layer on the map that contains 
> hot-spots? Can hot-spots be added to a map layer?
>
> I have no idea what a 'hot-spot' is, so I don't know :)


Image maps in a browser allow you define a clickable spot on the image
map (aka "hot-spot").  If I can display a map in Open Layer that
contains a "hot-spot", it would allow me to code programs/links/other
functions based on the user clicking on it.  


> 7) I added labels to my map by creating a gif layer that has a 
> transparent background.  Is it possible to add text labels to 
> objects/locations on the map to do this in a scalable fashion?
>
>OpenLayers has support for markers and popups, so you could put 
>dots on the map to do this, but there isn't a way to do this with text.



This would be a nice feature to have.


> 8) In order to get my image to load, I have to access the image 
> through an http reference and am running WAMP to serve up the image.  
> Is it possible to code the layer reference to get a graphic from the 
> root or sub-directory?

>Unfortunately, I don't understand this question. A piece of sample 
>Javascript code may help me here. 

This works, but I have to activate my WAMP server to use Open Layers
with this reference.

        var graphic2 = new OpenLayers.Layer.Image(
                            'Avalon Labels',
 
'http://localhost/Avalon/images/avalonlabels1.gif',
                            new OpenLayers.Bounds(-180, -88.759, 180,
88.759),
                            new OpenLayers.Size(4000, 1870),
                            options);
        graphic2.addOptions({isBaseLayer: false});

        var graphic = new OpenLayers.Layer.Image(
                            'Avalon',
                            'http://localhost/Avalon/images/avalon.jpg',
                            new OpenLayers.Bounds(-180, -88.759, 180,
88.759),
                            new OpenLayers.Size(4000, 1870),
                            options);

This does not work at all, but would be prefered since it would allow
the same code to be used locally for testing and remotely when published
to a website.

        var graphic2 = new OpenLayers.Layer.Image(
                            'Avalon Labels',
                            'images/avalonlabels1.gif',
                            new OpenLayers.Bounds(-180, -88.759, 180,
88.759),
                            new OpenLayers.Size(4000, 1870),
                            options);
        graphic2.addOptions({isBaseLayer: false});

        var graphic = new OpenLayers.Layer.Image(
                            'Avalon',
                            'images/avalon.jpg',
                            new OpenLayers.Bounds(-180, -88.759, 180,
88.759),
                            new OpenLayers.Size(4000, 1870),
                            options);

Thanks,
Robert J Becraft.




More information about the Users mailing list