[OpenLayers-Users] Panning a map with OpenLayers

David Pruitt d.pru at hotmail.com
Tue Jan 1 22:36:01 EST 2008


I have been programming for several years now, but I am fairly new to OpenLayers.  I am building a mapping application that in essence can be seen as being very similar to the example map shown at http://world.freemap.in/

Basically, the user can pan around the map, zoom in our out, etc., and click on a country to view certain information that we would like to display to our users - so in that way it is very similar to the example map that uses the CIA factbook.

I am still learning OpenLayers, and so it seemed like the best way to do this was to make a polygon which was the shape of each country in the world, and then take each of these polygons that I have created and overlay them on top of the appropriate country on the world map at the correct longitude/latitude.  Since polygons (which are features) can be selected, the user could easily pan around the map, click on a country, and the click would be captured by the overlying feature.  Once the click is captured...information is displayed in a window.

Here is the problem: I realized that (at least to my knowledge), panning is not allowed when the mouse is clicked on a selectable feature.  For example, if I have a feature which is the shape of a square sitting on top of part of Africa - I can click on the ocean next to it and pan around the map just fine.  If I just happen to click on that square however, yes....the square is selected....but I can't pan around the map!  Not unless I click outside of the square!  How can I remedy this problem?  

I notice that the example map that uses the CIA factbook allows me to pan.  For example, I can click and hold on China and pan around the map, but if I click and release on China - then it goes and retrieves the CIA factbook information from China.  I want to do the same for my mapping application, but I don't understand how to accomplish this yet with OpenLayers.

So that is my main question that I would like answered.

While I am writing this email, however, I would like to throw out one more question to the users.  Is OpenLayers compatible at all with ThickBox?  If that's not clear then I can explain a little bit more in a subsequent email.

Thanks!

David

_________________________________________________________________
i’m is proud to present Cause Effect, a series about real people making a difference.
http://im.live.com/Messenger/IM/MTV/?source=text_Cause_Effect
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080101/34e1feb1/attachment.html


More information about the Users mailing list