Git Product home page Git Product logo

custommapview's Introduction

CustomMapView

Custom map view for Android

Features

  • Rotate
  • Zoom
  • Scale
  • Add Marker
  • Marker Detail

Example

private fun initMapView() {
    val currentLocationLayer = CurrentLocationLayer().apply {
        locationProvider = object: CurrentLocationProvider {
            val loc = Location(1500f, 1500f)
            override fun getLocation(): Location = loc
        }
    }
    val markerLayer = MarkerLayer().apply {
        addMarker(Marker(1600f, 1600f, "Dummy Destination 1"))
        addMarker(Marker(1550f, 1700f, "Dummy Destination 2"))
        onPopupClickListener = {
            logi("Popup touched : $it")
            dismissPopup()
        }
    }

    mapView = binding.mapview
    mapView.setMapImage(R.drawable.map1)

    mapView.addLayer(currentLocationLayer)
    mapView.addLayer(markerLayer)
}

License

MIT License

This project is based on onlylemi/MapView

custommapview's People

Contributors

lunatk avatar

Stargazers

 avatar

Watchers

 avatar

custommapview's Issues

Drag does not prevent click event

Current Behavior

Click event is triggered even after dragging.

  • Marker click event
  • Long click event
  • Popup click event

Expected Behavior

Click event should not be triggered after dragging.

How to use this?

Hi, Can you please sphere some time to add a very small example of how to use this CustomMapView? I have added it in XML and then from kt file I have added an image up to this point it is working and helpful but when I try to add MarkeraLayer it is not doing anything. Your favour will be a great help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.