BuildingLayer: add shadow parameter #575
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2019 Gustl22
|
||||
* Copyright 2019 devemux86
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
@@ -19,34 +20,25 @@ import android.view.View;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
import org.oscim.renderer.ExtrusionRenderer;
|
||||
import org.oscim.renderer.light.Sun;
|
||||
|
||||
public class ShadowActivity extends SimpleMapActivity implements SeekBar.OnSeekBarChangeListener {
|
||||
|
||||
public ShadowActivity() {
|
||||
super(R.layout.activity_shadow);
|
||||
}
|
||||
|
||||
private SeekBar mSeekBar;
|
||||
|
||||
public ShadowActivity() {
|
||||
super(true, R.layout.activity_shadow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
BuildingLayer.SHADOW = true;
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mSeekBar = findViewById(R.id.seekBarShadow);
|
||||
mSeekBar.setOnSeekBarChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
BuildingLayer.SHADOW = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
int id = seekBar.getId();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016-2018 devemux86
|
||||
* Copyright 2016-2019 devemux86
|
||||
* Copyright 2019 Gustl22
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
@@ -41,14 +41,20 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
private DefaultMapScaleBar mapScaleBar;
|
||||
|
||||
BuildingLayer mBuildingLayer;
|
||||
LabelLayer mLabelLayer;
|
||||
|
||||
public SimpleMapActivity(int contentView) {
|
||||
super(contentView);
|
||||
}
|
||||
private boolean mShadow;
|
||||
|
||||
public SimpleMapActivity() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
public SimpleMapActivity(boolean shadow) {
|
||||
super();
|
||||
mShadow = shadow;
|
||||
}
|
||||
|
||||
public SimpleMapActivity(boolean shadow, int contentView) {
|
||||
super(contentView);
|
||||
mShadow = shadow;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,10 +66,9 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
|
||||
void createLayers() {
|
||||
GroupLayer groupLayer = new GroupLayer(mMap);
|
||||
mBuildingLayer = new BuildingLayer(mMap, mBaseLayer);
|
||||
mBuildingLayer = new BuildingLayer(mMap, mBaseLayer, false, mShadow);
|
||||
groupLayer.layers.add(mBuildingLayer);
|
||||
mLabelLayer = new LabelLayer(mMap, mBaseLayer);
|
||||
groupLayer.layers.add(mLabelLayer);
|
||||
groupLayer.layers.add(new LabelLayer(mMap, mBaseLayer));
|
||||
mMap.layers().add(groupLayer);
|
||||
|
||||
mapScaleBar = new DefaultMapScaleBar(mMap);
|
||||
|
||||
Reference in New Issue
Block a user