From add62c9fe862355171c95fa92ff786a13004128a Mon Sep 17 00:00:00 2001 From: Emux Date: Wed, 16 Nov 2016 14:18:14 +0200 Subject: [PATCH] Location layer: lazy rendering start for performance #171 --- .../src/org/oscim/android/test/LocationActivity.java | 2 +- vtm/src/org/oscim/layers/LocationLayer.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vtm-android-example/src/org/oscim/android/test/LocationActivity.java b/vtm-android-example/src/org/oscim/android/test/LocationActivity.java index 1ad889c0b..413de26d7 100644 --- a/vtm-android-example/src/org/oscim/android/test/LocationActivity.java +++ b/vtm-android-example/src/org/oscim/android/test/LocationActivity.java @@ -43,7 +43,6 @@ protected void onResume() { super.onResume(); enableAvailableProviders(); - locationLayer.setEnabled(true); } @Override @@ -56,6 +55,7 @@ protected void onPause() { @Override public void onLocationChanged(Location location) { + locationLayer.setEnabled(true); locationLayer.setPosition(location.getLatitude(), location.getLongitude(), location.getAccuracy()); // Follow location diff --git a/vtm/src/org/oscim/layers/LocationLayer.java b/vtm/src/org/oscim/layers/LocationLayer.java index 73d2185c3..fc45085af 100644 --- a/vtm/src/org/oscim/layers/LocationLayer.java +++ b/vtm/src/org/oscim/layers/LocationLayer.java @@ -27,6 +27,7 @@ public LocationLayer(Map map) { super(map); mRenderer = locationRenderer = new LocationRenderer(mMap, this); + setEnabled(false); } @Override