Create a message pool and path on static Google maps

I am trying to create a static map url using google maps api which is similar to the following

enter image description here

It looks like I need to increase the zoom levels and add a path parameter to the url. I tried to create a url as shown below.

http://maps.googleapis.com/maps/api/staticmap?scale=4&format=png32&center=50.133751,4.833644&zoom=16&size=640x640&markers=color:red%7C50.133751,4.833644&sensor=false&path=color:blue|48.133751,4.833644|50.133751,4.833644&style=feature:road.local 

But it does not give the required results, I need to create dynamic URLs based on the addresses and provided lat / lng values. For some reason, I need to rotate the map so that it always has a vertical road in the middle, so that I can pave the way for it. In addition, I need a bubble that will show a fixed time to reach 5/1 min.

I do not use any programming language yet. I am trying to create these URLs manually.

Thanks in advance.

EDIT: Now I do not need to rotate it. I just want to show a 1-5 minute direction for the given latitude / longitude / address and for the message bubble, I created a static image that I can show as an overlay.

+5
source share
1 answer

According to your specific needs, in order to show the path and time from 1 to 5 minutes, I would recommend the following:

First of all, you need to know that you have two possibilities regarding the label.

  • Use a standard marker and add a shortcut of length 1 and [AZ], [0-9] (so it's just the time in your case ... from one to five)
  • Use a custom icon that already contains a label (in your case, this is an option because you just have to create five images containing "2 minutes" or something like that)

For the first option, I will take the center of two connected points and add a white marker with a route duration label, for example markers=color:white|label:1|52,5210924,13,39181335 . Then you will have a white standard marker on your route, for example this .

For the second option, you can change the position of the marker away from the path (depending on how the image on the label looks) and add an image with the correct duration (1.png, 2.png, 3.png, ...) like markers=icon:https//your.path/to/image.png|52,5210924,13,39228335 . For example, you can include your own image, which will look like this (sorry for the bad image ;-)).

Adding a badge icon with a label (in the URL) is sadly not possible .

I think in your case (also when creating it manually) it would be nice to create 5 bubble images and add them as described in your static map. A faster and simpler (but not very good) way would be the first option, because you could place it directly in the path and not create bubble images.

+5
source

Source: https://habr.com/ru/post/1208276/


All Articles