How to add InfoWindow Object by using google static image map ?
Asked Answered
C

1

6

I want to add text labels to the image which i am getting from static google image api. Like a label and info window of all markers which is in simple google map.

I have seen the documentation, It is not documented clearly. Is it possible to display a infoWindow in google Static Image API.

Cherubini answered 16/5, 2014 at 4:24 Comment(0)
M
0

Currently, Marker labels or InfoWindows are not yet available for Google Maps Platform - Maps Static API.

But, we do have an existing feature request for this in our Google Issue Tracker. To express your interest and to subscribe you to its latest updates, I suggest that you star this entry: https://issuetracker.google.com/35818346

In the mean time, note that you could achieve something similar like this by using Custom Icons that already have the labels. However, this solution may take a lot of time as you will first have to edit the icon image you'll use to include the label then host it somewhere.

Please see this sample request: http://maps.googleapis.com/maps/api/staticmap?size=600x400&markers=icon:https://raw.githubusercontent.com/annkylah/TestRepo/master/icon2.png|anchor:26,68|scale:2|-35.281454,149.128545&markers=icon:https://raw.githubusercontent.com/annkylah/TestRepo/master/icon1.png|anchor:26,68|scale:2|-37.936915,145.169723&markers=icon:https://raw.githubusercontent.com/annkylah/TestRepo/master/icon3.png?raw=true|anchor:26,68|scale:2|-33.842312,150.983470&key=YOUR_API_KEY

Sample Static Map

Using Google Charts - Image Charts is also an option before, however, this service has been turned down last March 18, 2019.

The limitation that you should also take note with the Custom Icon workaround is that you could only specify up to five unique custom icons per Maps Static API request. There's a feature request filed on Google Issue Tracker to allow more than 5 custom icons however, it was marked as a duplicate of another feature request to support KML layers in Static Maps API.

I hope this helps!

Mcanally answered 19/12, 2019 at 6:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.