Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
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 18.104.22.168 release ready!
Owner and Founder. Opencart
In the last part of the working with AMaps, we learned about adding marker click event and info windows. Now we will learn about adding Tile overlay on the Amap.
As we know that Amaps is a Chinese product and it provides services for China because China doesn’t support Google Services. In the default version of Amaps, you will not be able to see the detailed maps of the countries other than China. To be able to see the maps for the whole world you need to enable the tile overlay. TileOverlay actually covers the map with another image which contains a detailed map of the whole world.
To get the tile overlay on your Amap you need to use addTileOverlay() function of your Amap object. You can look at the code given below for an example.
this will automatically cache the images so that when you open the same area it won’t take much longer to load.
Secondly, In this blog, we will learn about the getting an address from the latitude and longitude and this is known as Regeocoding. For this, you need to implement an interface in your class GeocodeSearch.OnGeocodeSearchListener. The interface contains two methods which you need to override. First one is onGeocodeSearched(GeocodeResult geocodeResult, int i) which is used when you need to get the latitude and longitude of the location from its name and the other one is onRegeocodeSearched(RegeocodeResult result, int rCode) which is used to get the address from the Latitude and Longitude.
After implementing the interface, you need to initialize a LatLongPoint object and create an object of GeocodeSearch which is being used the get the lat long or the address. You need to set a listener on GeocodeSearch Object so that it returns the result in the onRegeocodeSearched function.
Now you need to create a RegeocodeQuery object and pass it to the getFromLocationAsyn function.
Now if your Latitude and Longitude are correct it will return a list of addresses in your onRegeocodeSearched(RegeocodeResult result, int rCode) function and to get the result you can follow the below code.
That’s all for this section, Use the locations and addresses as per your requirements.
Thank you very much, this is Vedesh Kumar signing off.
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.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.