askarsyzdykov / MapView

A MapView on Android platform.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MapView

Forked from https://github.com/onlylemi/MapView

Android Arsenal jitpack license

This a indoor map view named MapView for Android. It also offer some layers. If you are doing a indoor map application and try to do it.

What's new and changed?

  • Marker
    • Instead using PointF class in some places
  • MapView
    • Double click for zoom in
    • Added zooming controls
    • Added compass button for rotate the map to 0°
  • MarkLayer
    • Renamed to MarkerLayer
    • New method 'addMarker(Marker)'
    • New method 'deleteMarker(Marker)'
    • New method 'clear()'
    • Custom selected marker icon
  • ShapeLayer
    • Shape - abstract class
    • Rect
    • Polygon

Layers

  • MapLayer
    • rotate
    • scale
    • slide
  • LocationLayer
    • Sensor
  • BitmapLayer
  • MarkerLayer
  • ShapeLayer
  • RouteLayer

Demo

I offer every layer demo and you can look the demo folder. And the following is a screenshot of demo.

Usage

  1. Include this project as module in your project
  2. Put in your layout
<kz.mobdev.mapview.library.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />
  1. Add this code in Activity/Fragment
MapView mapView = (MapView) findViewById(R.id.mapview);
Bitmap bitmap = null;
try {
    bitmap = BitmapFactory.decodeStream(getAssets().open("map.png"));
} catch (IOException e) {
    e.printStackTrace();
}
mapView.loadMap(bitmap);
mapView.setMapViewListener(new MapViewListener() {
    @Override
    public void onMapLoadSuccess() {
        
    }

    @Override
    public void onMapLoadFail() {
        
    }

});
  1. Enjoy!

About me

Welcome to pull requests.

If you have any new idea about this project, feel free to contact me.

About

A MapView on Android platform.

License:MIT License


Languages

Language:Java 100.0%