[OpenLayers-Users] Automatic links the Yahoo way

Lance Dyas lancelot at inetnebr.com
Thu Sep 13 09:07:46 EDT 2007


Jochen Topf wrote:
> On Wed, Sep 12, 2007 at 08:57:35AM -0500, Lance Dyas wrote:
>   
>> Jochen Topf wrote:
>>     
>>> On Tue, Sep 11, 2007 at 06:07:43PM -0700, mcarsel wrote:
>>>   
>>>       
>>>> Has anyone implemented a way to automatically update the url in openlayers
>>>> every time a user zooms or pans similar to the way Yahoo does it? 
>>>> Sample here: 
>>>> http://maps.yahoo.com/beta/#mvt=m&trf=0&lon=-94.350586&lat=38.169114&mag=14
>>>> http://maps.yahoo.com/beta/#mvt=m&trf=0&lon=-94.350586&lat=38.169114&mag=14  
>>>>
>>>> I saw a ticket about 4 months ago (#723) that proposed this as a new feature
>>>> in openlayers, but didn't see anything come of it.
>>>>
>>>> Permalinks are somewhat useful, but automatic url update like the way Yahoo
>>>> does it would be much better.  
>>>>     
>>>>         
>>> Cool idea. I don't think it should be part of OpenLayers itself, though.
>>>   
>>>       
>> Why? part of the point of doing it is that we can re-enable the browser
>> back button and make bookmarking the natural way without artificial
>> behaviors on the users part ... and that is a good thing it means no 
>> learning
>> new stuff to use your web map
>>     
>
> If this is in OpenLayers itself, 
There is a ticket for adding the full bookmarking and history functionality
and from most users view points permalink
is a superfulous concept that is what bookmarks/favorites are for.
> it would have to understand the URL.
> But it can't really do that.
ummm yes it does ;-) see below
>  Currently I am the one interpreting the
> lat, lon, zoom coordinates and if I want to rename them or have
> different ones for a different projection or additional parameters for
> layer or whatever, I can do that. If the functionality would be in OL,
> how would it do that? Maybe we can find a way of doing that properly.
> Any suggestions?
>   
There is a function that does parse the url already in OpenLayers.. 
perma link uses it
OpenLayers is open so you can dig under its hood. give it a shot .. 
check out the svn
consider this encouragement you can do it ... it is more fun and less 
like work
than you might imagine. I think the url parsing method is in Utils
 
>>> It can easly be done outside the core. I have implemented it quickly at
>>> http://geo.topf.org/map/indexhash.html and it seems to work. 
>>>       
>> You only did part of it... you need a timer that checks when the user 
>> goes back or forward
>> or manually changes the hash that the map responds to it
>>     
>
> Ok, I wasn't aware of that functionality. I'll have a look at it. I am
> not convinced it is that useful, but I agree that it is quite cool. :-)
>   
 One complaint about AJAX applications people have is that we sometimes 
break the old
paradigms too far and force users to do stuff they dont expect inorder 
to accomplish the same things
 making the browser behave as expected with regards to maps is actually 
very useful. Not having
extra buttons for bookmarking or going to previous views is one bug 
aboo... FLASH was heavily
 critisized for this.. one doesnt want DHTML/AJAX to suffer the same ;-)



More information about the Users mailing list