It is very simple to create a google map and center on a given location (see below). It is also similarity simple to create a google map and show markers on it by doing something like markers=color:blue%7Clabel:S%7C11211%7C11206%7C11222
.
How would I just create a simple centered map like the below, but add a single marker in the very center? Thanks
<img alt="Map" src="http://maps.google.com/maps/api/staticmap?center=+AUBURN+WA+98001&zoom=14&size=400x400&sensor=false">
For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.
I guess that the map automatically will fit to show the specified markers, here you will find
Marker Locations
Each marker descriptor must contain a set of one or more locations defining where to place the marker on the map. These locations may be either specified as latitude/longitude values or as addresses. These locations are separated using the pipe character (|).
The location parameters define the marker's location on the map. If the location is off the map, that marker will not appear in the constructed image provided that center and zoom parameters are supplied. However, if these parameters are not supplied, the Static Map server will automatically construct an image which contains the supplied markers. (See Implicit Positioning below.)
You could also add your own centered background image ontop if the map :)
background: url('yourmarker.png' ) center no-repeat, url(http://maps.google.com/maps/api/staticmap?center=AUBURN+WA+98001&zoom=14&&size=400x400);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With