URLHandler
Panoramax.utils.URLHandler
Kind: static class of Panoramax.utils
Emits: url-changed
- .URLHandler
- new URLHandler(parent)
- .listenToChanges()
- .destroy()
- .nextURLParams() ⇒
object - .nextURLString() ⇒
string - .currentURLParams([readFromHash]) ⇒
object - .currentMapString() ⇒
string - .currentPSVString() ⇒
string - .nextShortLink() ⇒
str - .getUnmanagedParameters(prevUrl)
- "url-changed"
new URLHandler(parent)
Updates the URL query part with various parent component information.
Note that you may call listenToChanges() for this class to be effective once parent is ready-enough.
| Param | Type | Description |
|---|---|---|
| parent | Basic |
The parent component |
urlHandler.listenToChanges()
Start listening to URL & parent changes through events. This leads to parent & URL updates.
Kind: instance method of URLHandler
urlHandler.destroy()
Call this function to stop listening to global events.
Kind: instance method of URLHandler
urlHandler.nextURLParams() ⇒ object
Compute next values to insert in URL
Kind: instance method of URLHandler
Returns: object - Query parameters
urlHandler.nextURLString() ⇒ string
Compute next URL query string (based on nextURLParams())
Kind: instance method of URLHandler
Returns: string - The query string
urlHandler.currentURLParams([readFromHash]) ⇒ object
Transforms current URL query string into key->value object
Kind: instance method of URLHandler
Returns: object - Key-value read from current URL query
| Param | Type | Default | Description |
|---|---|---|---|
| [readFromHash] | boolean |
false |
Switch to reading from hash URL part (for retro-compatibility) |
urlHandler.currentMapString() ⇒ string
Get string representation of map position
Kind: instance method of URLHandler
Returns: string - zoom/lat/lon or zoom/lat/lon/bearing/pitch
urlHandler.currentPSVString() ⇒ string
Get PSV view position as string
Kind: instance method of URLHandler
Returns: string - x/y/z
urlHandler.nextShortLink() ⇒ str
Get short link URL (query replaced by Base64)
Kind: instance method of URLHandler
Returns: str - The short link URL
urlHandler.getUnmanagedParameters(prevUrl)
Returns a string containing only parameters out of URLHandler scope
Kind: instance method of URLHandler
| Param | Type | Description |
|---|---|---|
| prevUrl | URL |
The previously set URL |
"url-changed"
URL changed event
Kind: event emitted by URLHandler
Properties
| Name | Type | Description |
|---|---|---|
| detail.url | string |
The new used URL |