Вопрос

So, I came here via the Google mailing list.

I'm trying to display a static map in a Qt application without using Javascript. So far I can get the right map specifying a center and a zoom level.

Now, I have two points and I want to fetch a map image that contains them and I managed to do it with markers.

Take this url as an example:

https://maps.googleapis.com/maps/api/staticmap?maptype=satellite&size=800x1024&markers=size:small|color:white|loc:43.29377958,-7.49701604|loc:43.35536742,-7.48278365&sensor=false

This is the image I receive:

Static map

The white markers are clearly visible in the maps. I have found a way to hide them via javascript but I'm wondering if there's a way to specify it in the url directly, without using javascript.

While I found a way to get rid of the marker symbols (my answer), I would like to know if there's a better/proper way to achieve this.

Это было полезно?

Решение

I found a way to fetch the same map without the marker symbols. Instead of using the marker label, I'm using the visible one.

https://maps.googleapis.com/maps/api/staticmap?maptype=satellite&size=600x640&visible=loc:43.29377958,-7.49701604|loc:43.35536742,-7.48278365&sensor=false

This brings:

enter image description here

When I read the docs, I misunderstood it and thought it was a boolean value, so when I tried visible=true or visible=false I would lose the view of my map and the markers would still be there.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top