IndoorMapView
ninepatch
34
Visit GitHub RepoMaps

IndoorMapView

Platform (Android) GitHub license GitHub stars

BETA Version

Android indoor map work in progress...

Requirements

The library requires Android API Level 9+.

How to use

activity_main.xml

      <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:fitsSystemWindows="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <indoormaps.ninepatch.com.library.IndoorMapsView
        android:id="@+id/indorMaps"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

MainActivity.class

public class MainActivity extends AppCompatActivity {

 private IndoorMapsView indoorMapsView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        indoorMapsView = (IndoorMapsView) findViewById(R.id.indorMaps);

        indoorMapsView.getIndoorViewListener().setOnMapViewInizializate(new OnMapViewInizializate() {
            @Override
            public void onMapLoading() {
          
            }

            @Override
            public void onMapinizializate() {
                 
                 indoorMapsView.init("mappa2.png", ZOOM.LEVEL4); //image from assets or put link
                 indoorMapsView.setBackgroundColorRes(R.color.colorPrimary);
                      
                       }

        });

   
    }
}

Add marker

                Marker marker = new Marker(MainActivity.this);
                marker.setId(1);
                marker.setLat(36.8271);
                marker.setLon(32.9731);
                marker.setName(getString(R.string.marker_name));
                marker.setImageLink("pointer.png");//from assets or put link
                
                //set Marker Style
                Style style = new Style(MainActivity.this);
                style.setLabelColor(R.color.colorAccent);
                style.setLabelPx(22);
                style.setShowLabel(true);
                marker.setStyle(style);
                
                indoorMapsView.addMarker(marker);

remove marker

                  indoorMapsView.removeMarker(marker.getId());
                  // OR
                  indoorMapsView.removeMarker(marker);

Listner

  indoorMapsView.getIndoorViewListener().setOnMarkerTapListener(new OnMarkerTapListener() {
            @Override
            public void onMarkerTap(Marker marker) {
         
            }
        });

        indoorMapsView.getIndoorViewListener().setOnTapListener(new OnTapListener() {
            @Override
            public void onTap(double lat, double lon) {
                
            }
        });

Center Map

    indoorMapsView.setCenter(lat, lng);

Animation

ANIMATION type: PAN, FLY ,SPIRAL

center map to point or marker whit animation

  indoorMapsView.goToAnimate(marker, ANIMATION.PAN);
Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT