Search code examples
openlayers-3url-parameters

URL parameters for Openlayers 3 to zoom to location?


I have an OL3 web application and I am wondering if it is possible to include URL parameters (such as coordinate values) for which the application can parse and open up at a specific location?

For example http://mywebsiteaddress?x=longitudevalue&y=latitudevalue

Is this something that can be done using OL3?


Solution

  • Sure, see: http://openlayers.org/en/latest/examples/permalink.html for an example (uses an anchor instead of url parameters but the idea is the same).