Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 188.8.131.52 release ready!
Owner and Founder. Opencart
In the last part of the working with AMaps we learned about how to show a basic map in your activity. In this section we will learn about using different may type (Like NORMAL, SATELLITE, NIGHT etc.) in the app and adding markers.
We will be considering that you have already applied the basic map on the app if not then you can go to this link and learn how to do it.
After this, you have to create some buttons in your layout which will control the map types and on the button click all you need to do is call the setMapType of AMap‘s object.
This will change the map type and your map will work accordingly.
Now let us see how to add the marker on your map. It is quite easy actually, there is a MarkerOptions class which will help you to do that. Try the below code with a Latlng and it will add a marker on your map.
In the above code BitmapDescriptorFactory.HUE_AZURE defines the type of your marker. They have provide inbuilt markers with various color. You can go for HUE_BLUE, HUE_RED etc.
After the MarkerOptions object is initialized you need yo call the addMarker function of your AMap‘s object and it will draw a marker on the map.
Thank you very much, this is Vedesh Kumar signing off.
<—– PART 1
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
It was a successful collaboration. The Mobikul team provided the client everything they needed in a timely and high-quality manner. They were very professional, reliable, and accessible during the entire process. The client also saw no room for any improvements in the vendor's performance.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.