Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
mapbox sdk + gsimap (kotlin)
package org.smellman.mapboxsdktest
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import com.mapbox.mapboxsdk.api.ILatLng
import com.mapbox.mapboxsdk.geometry.LatLng
import com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer
import com.mapbox.mapboxsdk.views.MapView
public class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
val mv:MapView = findViewById( as MapView
val defaultCenter:ILatLng = LatLng(35.362222, 138.731389)
val defaultZoom:Float = 5f
override fun onCreateOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this adds items to the action bar if it is present.
menuInflater.inflate(, menu)
return true
override fun onOptionsItemSelected(item: MenuItem): Boolean {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
val id = item.itemId
//noinspection SimplifiableIfStatement
if (id == {
return true
return super.onOptionsItemSelected(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment