[OpenLayers-Users] Browser back and forward button

Paul Spencer pagameba at gmail.com
Wed Jul 30 09:40:31 EDT 2008


I've used this before in other applications with some success:

http://code.google.com/p/reallysimplehistory/

Cheers

Paul

On 30-Jul-08, at 8:42 AM, Christopher Schmidt wrote:

> On Tue, Jul 29, 2008 at 10:19:29PM -0700, Matthew Doyle wrote:
>>
>> Hi OpenLayers Users,
>>
>> My client has a need to place control on the users browser back and  
>> forward
>> buttons. Simply put, when he does any sort of action like zoom,  
>> pan, switch
>> a layer on, etc. he always assumes that the back button will take  
>> him to the
>> last state he was in within the mapping tool.  As such, he has now  
>> requested
>> that this become a feature.
>>
>> a) is it possible to control this? The only way i can think of is  
>> each time
>> a user initiates an action, that it is stored in the hashmap in the  
>> URL ...
>> index.html?zoom=1&layers=xxx similar to a permalink that is updated  
>> after
>> every action.
>
> This particular implementation will force a page reload with every
> action, so is likely not a good choice.
>
> There are several sets of resources on the web for solving this  
> problem
> in various ways: storing data in the post-hash section of the URL,
> putting data in a hidden iframe and reloading, etc. You'd need to
> research and pick one.
>
>
>> b) is there any code that anybody has already written to do this?
>
> Not that I'm aware of. It's a longstanding feature request with no  
> work
> done on it so far.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list