sharenowTech/AnyMaps

Adding map markers

Closed this issue · 1 comments

Is there and example of how to add a map marker.

I am wanting to show my current position and a destination position.

Here is how you can do it.

First, initialize the MapsConfiguration.

MapsConfiguration.getInstance().initialize(this);

Second, add the marker as soon as the map is available.

mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(AnyMap anyMap) {
        anyMap.addMarker(
                new MarkerOptions()
                        .position(new LatLng(0, 0))
                        .icon(
                                BitmapDescriptorFactory.getInstance()
                                        .fromResource(R.drawable.marker)
                        )
        );
    }
});

I also updated the sample app, so that you can run it and try it.