question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extend map api to return the image directly

See original GitHub issue

First 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:closed
  • Created 5 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
rytilahticommented, Sep 11, 2018

@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).

1reaction
wills106commented, Sep 21, 2018

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found