fix: 增加omdb图层管理
This commit is contained in:
@@ -249,7 +249,7 @@ public final class NIMapView extends RelativeLayout {
|
||||
|
||||
// 增加比例尺图层
|
||||
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
||||
naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, 25, 60);
|
||||
naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, 20, 84);
|
||||
|
||||
// if (gridLayer == null) {
|
||||
// gridLayer = new TileGridLayer(getVtmMap());
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.oscim.layers.vector.VectorLayer
|
||||
import org.oscim.layers.vector.geometries.Style
|
||||
import org.oscim.map.Map
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler(context, mapView),
|
||||
Map.UpdateListener {
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class OMDBDataDecoder extends TileDecoder {
|
||||
listResult.stream().iterator().forEachRemaining(new Consumer<RenderEntity>() {
|
||||
@Override
|
||||
public void accept(RenderEntity renderEntity) {
|
||||
Log.d("RealmDBTileDataSource", renderEntity.getGeometry());
|
||||
// Log.d("RealmDBTileDataSource", renderEntity.getGeometry());
|
||||
Map<String, Object> properties= new HashMap<>(renderEntity.getProperties().size());
|
||||
properties.putAll(renderEntity.getProperties());
|
||||
parseGeometry(renderEntity.getTable(), renderEntity.getWkt(), properties);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
||||
}
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class RealmDBTileDataSource implements ITileDataSource {
|
||||
List<GeometryFeatureEntity> listResult = realmQuery.distinct("id").findAll();
|
||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
package org.videolan.vlc;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
@@ -364,10 +365,10 @@ public class Util {
|
||||
return dp;
|
||||
}
|
||||
|
||||
public static int convertDpToPx(int dp) {
|
||||
public static int convertDpToPx(Context context,int dp) {
|
||||
return Math.round(
|
||||
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
VLCApplication.getAppResources().getDisplayMetrics())
|
||||
context.getResources().getDisplayMetrics())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user