Extend map api to return the image directly
See original GitHub issueFirst of all, thanks for working on this. From all the possible ways to access the map your approach seems to be the nicest one!
It would be nice to have an ability to request the generated image data directly without fetching the mapsrc-contained URL. A new parameter return_image=true
could be added to return the PNG data (and proper HTTP content-type) as a response, which would allow direct integration to, e.g., homeassistant via https://www.home-assistant.io/components/camera.generic/
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
javascript - Save current Google Map as image - Stack Overflow
I had a look at https://developers.google.com/maps/documentation/javascript/reference#Map but there seems to be no method that returns a URL or image for the ...
Read more >Static Images | API - Mapbox docs
The Mapbox Static Images API returns static images generated from vector map styles.
Read more >Get Started | Maps Static API - Google Developers
The Maps Static API returns an image (either GIF, PNG or JPEG) in response to an HTTP request via a URL. For each...
Read more >Render - Get Map Image - REST API (Azure Maps)
The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported...
Read more >Export Map—ArcGIS REST APIs
When users perform an export with the format of image, the server responds by directly streaming the image bytes to the client. With...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Bennedetto yeah, I can see that it’s returning a path to it, what I’d like to have is to allow returning the image data directly (as then there’s no need on the 3rd party software to parse any JSON and handle it separately). So
http://vacuum.local/api/remote/map?drawRobot=true&drawCharger=true&scale=5&border=3&doCropping=true&drawPath=true&returnImage=true
would return a mime-type header (Content-Type: image/png
) followed by the raw, generated image data. This could then be directly used to get the image (without parsing any JSON).@rytilahti If you are using Home Assistant have you seen my post about how I integrate Valetudo into my setup? https://community.home-assistant.io/t/valetudo-xiaomi-vacuum-dustcloud-alternative-live-maps/66277 I am wills106