API for static Panorama
Panorama on Mapy.cz is a feature similar to Street View that allows you to explore most streets in the Czech Republic and look around in all directions.
For developers, there are currently two ways to use Panorama:
- JS Panorama – A JavaScript component that provides your users with a similar experience to Mapy.cz. It allows free navigation and movement in a panoramic view directly within your application. Read more in the JS Panorama section.
- Static Panorama (covered in this section) – A REST API that returns a static image of a selected location view. Simply embed it using
<img src="...">
, specifying the position and view direction in the parameters. The image is fixed and cannot be rotated further.
The image on the right is generated using the static panorama function with this code.
<img src="https://api.mapy.cz/v1/static/pano?width=400&height=250&lon=16.6&lat=49.19&yaw=0&apikey={yourApiKey}" >
For more usage examples, see Static Panorama Tutorial.
Where to Use Static Panorama
- The static panorama is most commonly used when you need to display a photo of a specific location but don’t have one available. Instead of a photo, you can show a panoramic view of that place.
- It can also be used as a quick-loading placeholder where you want to offer users access to a dynamic panorama. Instead of immediately loading JavaScript for the “full” panorama, a static view is shown first, and the dynamic JS Panorama loads only after the user clicks on it.
Technical Documentation
https://api.mapy.cz/v1/docs/static/
The technical documentation provides a detailed description of input parameters, return values, limitations, default values, error states, and other details.
Function Description
- Static Panorama – The function returns a JPEG image with the specified size, showing a view from a chosen location in the specified direction. Of course, only if a panorama is available near the selected location.
Warning: Images obtained from this function are intended for online display only. They cannot be stored or cached long-term – see the terms of service.
Input Parameters
Basic Parameters | |
lon, lat | Coordinates around which the nearest panorama is searched, within the specified radius (see the radius parameter). |
width, height | Desired image dimensions in pixels. The maximum size is 1024 px. |
radius | Maximum radius for searching a panorama, in meters. Default value: 50 m |
yaw | Orientation relative to the north. Possible values: “auto” – default value, orientation in the direction of the photo “point” – orientation towards the input coordinates Number – 0 – 2 * Math.PI (0 – north) |
pitch | Tilting (– up, + down). Possible values: ±Math.PI Default value: 0 |
fov | Horizontal field of view (essentially zoom). Possible values: Math.PI / 2 – Math.PI/20 Default value: 1.2 |
lang | Preferred language, affects only the copyright text overlay. |
debug | If set to debug=true, error details are returned in JSON format. |