Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Creategoogle maps marker with custom image/bitmap

@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;


    //When Map Loads Successfully
    mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
        @Override
        public void onMapLoaded() {

            LatLng customMarkerLocationOne = new LatLng(28.583911, 77.319116);
            LatLng customMarkerLocationTwo = new LatLng(28.583078, 77.313744);
            LatLng customMarkerLocationThree = new LatLng(28.580903, 77.317408);
            LatLng customMarkerLocationFour = new LatLng(28.580108, 77.315271);

            //LatLngBound will cover all your marker on Google Maps
            LatLngBounds.Builder builder = new LatLngBounds.Builder();
            builder.include(customMarkerLocationOne); //Taking Point A (First LatLng)
            builder.include(customMarkerLocationThree); //Taking Point B (Second LatLng)
            LatLngBounds bounds = builder.build();
            CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, 200);
            mMap.moveCamera(cu);
            mMap.animateCamera(CameraUpdateFactory.zoomTo(14), 2000, null);
        }
    });
}
Comment

PREVIOUS NEXT
Code Example
Java :: AccountDriver.java 
Java :: influx cli with docker container 
Java :: input method manager hide keyboard 
Java :: how to pass parameters to xsl file 
Java :: gson to class 
Java :: how to make bidirectional fromated binding 
Java :: internal hashcode 
Java :: android how to get month on world programmatically 
Java :: java %2C 
Java :: taking user input in array in java using constructor 
Java :: the crystallization in time is the phenomenon that we call synchronization 
Java :: sum of number from list 
Java :: springBoot Register a Custom Auto-Configuration 
Java :: kotlin to java converter online 
Java :: java function that returns the index of the largest value in an array 
Java :: Iterating & Adding to a Stack 
Java :: how to set up basic java workspace 
Java :: final private vs private final 
Java :: set length java 
Java :: Create four (4) Java classes named Color, Model, Car, and CarDemo. 
Java :: resources/android/xml/network_security_config.xml 
Java :: remove activity from recent list android 
Java :: final java 
Java :: java webelement how to double click 
Java :: JAVA Printing Variables and Literals 
Java :: How to change numbers to english in printf 
Java :: java jbutton hover 
Java :: call c function from java 
Java :: randpm years java 
Java :: Based on the method exampleMethod, what is the return type of the method? 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =