Skip to content

Instantly share code, notes, and snippets.

@AsynctaskCoffee
Created August 30, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AsynctaskCoffee/8c8be20847e426515b747c03bc70c452 to your computer and use it in GitHub Desktop.
Save AsynctaskCoffee/8c8be20847e426515b747c03bc70c452 to your computer and use it in GitHub Desktop.
MainActivity
public class MainActivity extends AppCompatActivity implements MapListener{
OfflineMapView offlineMapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
offlineMapView = findViewById(R.id.map);
offlineMapView.init(this, this);
}
@Override
public void mapLoadSuccess(MapView mapView, MapUtils mapUtils) {
offlineMapView.setInitialPositionAndZoom(new GeoPoint(41.025135, 28.974101), 14.5);
Marker marker = new Marker(mapView);
marker.setPosition(new GeoPoint(41.025135, 28.974101));
marker.setIcon(getResources().getDrawable(R.drawable.bonuspack_bubble));
marker.setTitle("Hello Istanbul");
marker.showInfoWindow();
mapView.getOverlays().add(marker);
mapView.invalidate();
}
@Override
public void mapLoadFailed(String ex) {
Log.e("ex:", ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment