![how to create a custom map on google maps how to create a custom map on google maps](https://www.gmapswidget.com/wp-content/uploads/2016/06/google-my-maps.jpg)
You must download the image from an background thread (you could use AsyncTask or Volley or RxJava for that).Īfter that you can replace the codeResource(getResources(), R.er_picture_image) with your downloaded image bmImg. HttpURLConnection conn = (HttpURLConnection) url.openConnection() Now you also want to download a picture from an URL. You can start by looking at the Canvas and Drawables from the Android Developer page.
#How to create a custom map on google maps how to
The code should (mostly) speak for itself, there are many tutorials out there how to draw a Canvas. This draws the Canvas canvas1 onto the GoogleMap mMap.
![how to create a custom map on google maps how to create a custom map on google maps](https://www.google.com/maps/about/images/mymaps/mymaps-white-laptop.png)
Specifies the anchor to be at a particular point in the marker image. paint defines the text color, stroke width and sizeĬanvas1.drawBitmap(codeResource(getResources(), In this post, I will show you how easily you can create your own maps using Google My Maps. Easily create custom maps with the places that matter to you. Once you create your custom maps, you can share it with your team or anyone. icon(omResource(R.drawable.arrow))) Īs this just replaces the marker with an image you might want to use a Canvas to draw more complex and fancier stuff: Bitmap.Config conf = _8888 īitmap bmp = Bitmap.createBitmap(80, 80, conf) You can create your own maps by adding several other layers on top of the Google Map using the Google My Maps feature. 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. MSydney = mMap.addMarker(new MarkerOptions() Step 3: Adding a custom marker in Google Maps. In the Google Maps API v2 Demo there is a MarkerDemoActivity class in which you can see how a custom Image is set to a GoogleMap.