本文整理汇总了Java中org.oscim.map.Map类的典型用法代码示例。如果您正苦于以下问题:Java Map类的具体用法?Java Map怎么用?Java Map使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Map类属于org.oscim.map包,在下文中一共展示了Map类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onMapEvent
import org.oscim.map.Map; //导入依赖的package包/类
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
if (e == Map.ANIM_START) {
// throw new RuntimeException("Use MapView animator instance of map.animator");
mAnimator.cancel();
} else if (e == Map.POSITION_EVENT) {
{// set yOffset at dependency of tilt
if (mapPosition.getTilt() > 0) {
float offset = MathUtils.linearInterpolation
(viewport().getMinTilt(), viewport().getMaxTilt(), 0, 0.8f, mapPosition.getTilt());
viewport().setMapScreenCenter(offset);
} else {
viewport().setMapScreenCenter(0);
}
}
}
// mostly handled at MapView
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:19,代码来源:CacheboxMapAdapter.java
示例2: MapCoverageLayer
import org.oscim.map.Map; //导入依赖的package包/类
public MapCoverageLayer(Context context, Map map, Index mapIndex, float scale) {
super(map);
mContext = context;
mMapIndex = mapIndex;
mPresentAreaStyle = AreaStyle.builder().fadeScale(FADE_ZOOM).blendColor(COLOR_ACTIVE).blendScale(10).color(Color.fade(COLOR_ACTIVE, AREA_ALPHA)).build();
mOutdatedAreaStyle = AreaStyle.builder().fadeScale(FADE_ZOOM).blendColor(COLOR_OUTDATED).blendScale(10).color(Color.fade(COLOR_OUTDATED, AREA_ALPHA)).build();
mMissingAreaStyle = AreaStyle.builder().fadeScale(FADE_ZOOM).blendColor(COLOR_MISSING).blendScale(10).color(Color.fade(COLOR_MISSING, AREA_ALPHA)).build();
mDownloadingAreaStyle = AreaStyle.builder().fadeScale(FADE_ZOOM).blendColor(COLOR_DOWNLOADING).blendScale(10).color(Color.fade(COLOR_DOWNLOADING, AREA_ALPHA)).build();
mSelectedAreaStyle = AreaStyle.builder().fadeScale(FADE_ZOOM).blendColor(COLOR_SELECTED).blendScale(10).color(Color.fade(COLOR_SELECTED, AREA_ALPHA)).build();
mDeletedAreaStyle = AreaStyle.builder().fadeScale(FADE_ZOOM).blendColor(COLOR_DELETED).blendScale(10).color(Color.fade(COLOR_DELETED, AREA_ALPHA)).build();
mLineStyle = LineStyle.builder().fadeScale(FADE_ZOOM + 1).color(Color.fade(Color.DKGRAY, 0.6f)).strokeWidth(0.5f * scale).fixed(true).build();
mTextStyle = TextStyle.builder().fontSize(11 * scale).fontStyle(Paint.FontStyle.BOLD).color(COLOR_TEXT).strokeColor(COLOR_TEXT_OUTLINE).strokeWidth(7f).build();
mSmallTextStyle = TextStyle.builder().fontSize(8 * scale).fontStyle(Paint.FontStyle.BOLD).color(COLOR_TEXT).strokeColor(COLOR_TEXT_OUTLINE).strokeWidth(5f).build();
mHillshadesBitmap = getHillshadesBitmap(Color.fade(Color.DKGRAY, 0.8f));
mPresentHillshadesBitmap = getHillshadesBitmap(Color.WHITE);
mDateFormat = DateFormat.getDateFormat(context);
mMapIndex.addMapStateListener(this);
mAccountHillshades = Configuration.getHillshadesEnabled();
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:20,代码来源:MapCoverageLayer.java
示例3: setMapLocation
import org.oscim.map.Map; //导入依赖的package包/类
/**
* Set map location with or without animation
*
* @param map
* @param boundingBox
* @param locationAnimationTime
*/
public static void setMapLocation(final Map map, final BoundingBox boundingBox, int locationAnimationTime) {
final Animator animator = map.animator();
// zero will not move the map, set 1 ms
if (locationAnimationTime == 0 || isAnimateLocation == false) {
locationAnimationTime = 1;
}
animator.cancel();
animator.animateTo(//
locationAnimationTime,
boundingBox,
Easing.Type.SINE_INOUT,
Animator.ANIM_MOVE | Animator.ANIM_SCALE);
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:Map25ConfigManager.java
示例4: setMapLocation_InMapThread
import org.oscim.map.Map; //导入依赖的package包/类
private static void setMapLocation_InMapThread(final Map map, final MapPosition mapPosition) {
// final boolean isAnimation = animationTime != 0 && isAnimateLocation;
//
// if (isAnimation) {
//
// final Animator animator = map.animator();
//
// animator.cancel();
// animator.animateTo(
// (long) (animationTime * 1000),
// mapPosition,
// animationEasingType);
// } else {
//
map.setMapPosition(mapPosition);
map.setMapPosition(mapPosition);
// }
map.updateMap(true);
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:22,代码来源:Map25ConfigManager.java
示例5: getDrawable
import org.oscim.map.Map; //导入依赖的package包/类
@Override
public Drawable getDrawable(Map map) {
if (!isVisible() || removed) return null;
List<GeoPoint> points = new ArrayList<GeoPoint>();
for (LatLng point : options.getPoints()) {
points.add(GmsMapsTypeHelper.fromLatLng(point));
}
if (points.size() < 3 || (points.size() == 3 && points.get(2).equals(points.get(0)))) {
// Need at least 3 distinguished points to draw a polygon
return null;
}
// TODO: holes
return new PolygonDrawable(points, Style.builder()
.fillAlpha(1)
.strokeColor(getStrokeColor())
.strokeWidth(getStrokeWidth())
.fillColor(getFillColor())
.build());
}
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:20,代码来源:PolygonImpl.java
示例6: shouldUse10MegResponseCache
import org.oscim.map.Map; //导入依赖的package包/类
@Test
public void shouldUse10MegResponseCache() throws Exception {
Map map = mapFragment.getMap();
TileLayer baseLayer = field("mBaseLayer").ofType(TileLayer.class).in(map).get();
UrlTileSource tileSource =
(UrlTileSource) field("mTileSource").
ofType(TileSource.class).in(baseLayer).get();
HttpEngine.Factory engine = field("mHttpFactory").
ofType(HttpEngine.Factory.class).in(tileSource).get();
OkHttpClient client = field("mClient").ofType(OkHttpClient.class).in(engine).get();
HttpResponseCache cache =
(HttpResponseCache) field("responseCache").
ofType(OkResponseCache.class).in(client).get();
assertThat(cache.getMaxSize()).isEqualTo(MapFragment.CACHE_SIZE);
}
开发者ID:mapzen,项目名称:open,代码行数:17,代码来源:MapFragmentTest.java
示例7: shouldUseResponseCacheStoredOnFile
import org.oscim.map.Map; //导入依赖的package包/类
@Test
public void shouldUseResponseCacheStoredOnFile() throws Exception {
Map map = mapFragment.getMap();
TileLayer baseLayer = field("mBaseLayer").ofType(TileLayer.class).in(map).get();
UrlTileSource tileSource =
(UrlTileSource) field("mTileSource").
ofType(TileSource.class).in(baseLayer).get();
HttpEngine.Factory engine = field("mHttpFactory").
ofType(HttpEngine.Factory.class).in(tileSource).get();
OkHttpClient client = field("mClient").ofType(OkHttpClient.class).in(engine).get();
HttpResponseCache cache =
(HttpResponseCache) field("responseCache").
ofType(OkResponseCache.class).in(client).get();
assertThat(cache.getDirectory().getAbsolutePath()).
isEqualTo(activity.getExternalCacheDir().getAbsolutePath() + "/tile-cache");
}
开发者ID:mapzen,项目名称:open,代码行数:18,代码来源:MapFragmentTest.java
示例8: ItemizedOverlayWithBubble
import org.oscim.map.Map; //导入依赖的package包/类
public ItemizedOverlayWithBubble(Map map, Context context,
MarkerSymbol marker, List<Item> list, InfoWindow bubble) {
super(map, list, marker, null);
if (bubble != null) {
mBubble = bubble;
} else {
// build default bubble:
String packageName = context.getPackageName();
if (layoutResId == 0) {
layoutResId = context.getResources().getIdentifier(
"layout/bonuspack_bubble",
null,
packageName);
if (layoutResId == 0)
Log.e(BonusPackHelper.LOG_TAG,
"ItemizedOverlayWithBubble: layout/bonuspack_bubble not found in "
+ packageName);
}
mBubble = new DefaultInfoWindow(layoutResId, App.view);
}
mItemWithBubble = null;
mOnItemGestureListener = this;
}
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:26,代码来源:ItemizedOverlayWithBubble.java
示例9: onCreate
import org.oscim.map.Map; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
Map map = this.map();
VectorTileLayer baseLayer = map.setBaseMap(new OSciMap4TileSource());
map.layers().add(new BuildingLayer(map, baseLayer));
map.layers().add(new LabelLayer(map, baseLayer));
map.setTheme(VtmThemes.DEFAULT);
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
map.setMapPosition(53.5620092, 9.9866457, 1 << 16);
// mMap.layers().add(new TileGridLayer(mMap));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:17,代码来源:TestActivity.java
示例10: onMapEvent
import org.oscim.map.Map; //导入依赖的package包/类
@Override
public void onMapEvent(Event event, MapPosition mapPosition) {
if (event == Map.CLEAR_EVENT) {
/* sync with TileRenderer */
synchronized (mRenderer) {
tileRenderer().clearTiles();
mTileManager.init();
}
if (mTileManager.update(mapPosition))
notifyLoaders();
} else if (event == Map.POSITION_EVENT) {
if (mTileManager.update(mapPosition))
notifyLoaders();
}
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:19,代码来源:TileLayer.java
示例11: TileManager
import org.oscim.map.Map; //导入依赖的package包/类
public TileManager(Map map, int cacheLimit) {
mMap = map;
mMaxZoom = 20;
mMinZoom = 0;
mCacheLimit = cacheLimit;
mCacheReduce = 0;
mViewport = map.viewport();
jobQueue = new JobQueue();
mJobs = new ArrayList<MapTile>();
mTiles = new MapTile[mCacheLimit];
mTilesEnd = 0;
mTilesToUpload = 0;
mUpdateSerial = 0;
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:18,代码来源:TileManager.java
示例12: prepareDialog
import org.oscim.map.Map; //导入依赖的package包/类
public void prepareDialog(Map map, final Dialog dialog) {
EditText editText = (EditText) dialog.findViewById(R.id.latitude);
MapPosition mapCenter = map.getMapPosition();
editText.setText(Double.toString(mapCenter.getLatitude()));
editText = (EditText) dialog.findViewById(R.id.longitude);
editText.setText(Double.toString(mapCenter.getLongitude()));
SeekBar zoomlevel = (SeekBar) dialog.findViewById(R.id.zoomLevel);
zoomlevel.setMax(Viewport.MAX_ZOOMLEVEL);
zoomlevel.setProgress(10);
final TextView textView = (TextView) dialog.findViewById(R.id.zoomlevelValue);
textView.setText(String.valueOf(zoomlevel.getProgress()));
zoomlevel.setOnSeekBarChangeListener(new SeekBarChangeListener(textView));
}
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:19,代码来源:LocationDialog.java
示例13: showBubble
import org.oscim.map.Map; //导入依赖的package包/类
/**
* Populates this bubble with all item info:
* <ul>
* title and description in any case,
* </ul>
* <ul>
* image and sub-description if any.
* </ul>
* and centers the map on the item. <br>
*
* @param bubble
* ...
* @param map
* ...
*/
public void showBubble(InfoWindow bubble, Map map) {
// offset the bubble to be top-centered on the marker:
// Drawable marker = getMarker(0 /* OverlayItem.ITEM_STATE_FOCUSED_MASK */);
// int markerWidth = 0, markerHeight = 0;
// if (marker != null) {
// markerWidth = marker.getIntrinsicWidth();
// markerHeight = marker.getIntrinsicHeight();
// } // else... we don't have the default marker size => don't user default
// // markers!!!
// Point markerH = getHotspot(getMarkerHotspot(), markerWidth, markerHeight);
// Point bubbleH = getHotspot(HotspotPlace.TOP_CENTER, markerWidth, markerHeight);
// bubbleH.offset(-markerH.x, -markerH.y);
//
// bubble.open(this, bubbleH.x, bubbleH.y);
// OverlayMarker marker = getMarker();
// PointF hotspot = marker.getHotspot();
// Bitmap b = marker.getBitmap();
//bubble.open(this, (int)(-b.getWidth() * hotspot.x), (int)(-b.getHeight()));
//bubble.open(this, 0, (int)(b.getHeight()));
bubble.open(this, 0, 0);
}
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:39,代码来源:ExtendedMarkerItem.java
示例14: getLayer
import org.oscim.map.Map; //导入依赖的package包/类
@Override
public Layer getLayer(Map map) {
if (vectorTileLayer == null) vectorTileLayer = createVectorTileLayer(map);
GroupLayer layer = new GroupLayer(map);
layer.layers.add(new BuildingLayer(map, vectorTileLayer));
layer.layers.add(new LabelLayer(map, vectorTileLayer));
return layer;
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:9,代码来源:AbstractVectorLayer.java
示例15: DirectLineLayer
import org.oscim.map.Map; //导入依赖的package包/类
/**
* @param map ...
*/
public DirectLineLayer(Map map) {
super(map, new DirectLineRenderer());
directLineRenderer = (DirectLineRenderer) mRenderer;
directLineRenderer.setLayer(this);
de.longri.cachebox3.events.EventHandler.add(this);
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:10,代码来源:DirectLineLayer.java
示例16: WaypointLayer
import org.oscim.map.Map; //导入依赖的package包/类
public WaypointLayer(Map map, LinkedHashMap<Object, TextureRegion> textureRegionMap) {
super(map);
log.debug("Create new INSTANCE");
mClusterRenderer = new WaypointLayerRenderer(this, null);
mRenderer = mClusterRenderer;
mItemList = new ClusteredList();
populate(true);
this.textureRegionMap = textureRegionMap;
//initial Overlay styles
selectedStyle = VisUI.getSkin().get("selectOverlay", MapWayPointItemStyle.class);
smallSelected = selectedStyle.small != null ? textureRegionMap.get(((GetName) selectedStyle.small).getName()) : null;
middleSelected = selectedStyle.middle != null ? textureRegionMap.get(((GetName) selectedStyle.middle).getName()) : null;
largeSelected = selectedStyle.large != null ? textureRegionMap.get(((GetName) selectedStyle.large).getName()) : null;
disabledStyle = VisUI.getSkin().get("disabledOverlay", MapWayPointItemStyle.class);
smallDisabled = disabledStyle.small != null ? textureRegionMap.get(((GetName) disabledStyle.small).getName()) : null;
middleDisabled = disabledStyle.middle != null ? textureRegionMap.get(((GetName) disabledStyle.middle).getName()) : null;
largeDisabled = disabledStyle.large != null ? textureRegionMap.get(((GetName) disabledStyle.large).getName()) : null;
//register as cacheListChanged eventListener
CacheListChangedEventList.Add(this);
CacheListChangedEvent();
//register SelectedCacheChangedEvent
de.longri.cachebox3.events.EventHandler.add(this);
Settings.ShowAllWaypoints.addChangedEventListener(new IChanged() {
@Override
public void isChanged() {
CacheListChangedEvent();
}
});
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:38,代码来源:WaypointLayer.java
示例17: LocationLayer
import org.oscim.map.Map; //导入依赖的package包/类
public LocationLayer(Map map, LinkedHashMap<Object, TextureRegion> textureRegionMap) {
super(map);
mRenderer = locationRenderer = new LocationRenderer(map, this);
this.textureRegionMap = textureRegionMap;
style = VisUI.getSkin().get("myLocation", MapArrowStyle.class);
String bmpName = ((GetName) style.myLocation).getName();
setArrow(textureRegionMap.get(bmpName));
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:12,代码来源:LocationLayer.java
示例18: MapAnimator
import org.oscim.map.Map; //导入依赖的package包/类
public MapAnimator(Map map) {
this.map = map;
this.mapX = new DoubleAnimator();
this.mapY = new DoubleAnimator();
this.scale = new DoubleAnimator();
this.rotate = new DoubleAnimator();
this.tilt = new DoubleAnimator();
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:9,代码来源:MapAnimator.java
示例19: onMapEvent
import org.oscim.map.Map; //导入依赖的package包/类
@Override
public void onMapEvent(Event e, MapPosition mapPosition) {
//Log.w("LI", "C: " + (e == Map.CLEAR_EVENT) + " P: " + (e == Map.POSITION_EVENT) + " M: " + (e == Map.MOVE_EVENT) + " R: " + (e == Map.REDRAW_EVENT) + " U: " + (e == Map.UPDATE_EVENT));
if (e == Map.POSITION_EVENT) {
updateLocation(mapPosition.getLatitude(), mapPosition.getLongitude(), mapPosition.getZoomLevel());
}
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:8,代码来源:LocationInformation.java
示例20: TrackLayer
import org.oscim.map.Map; //导入依赖的package包/类
public TrackLayer(Map map, Track track) {
super(map);
mWorker = new Worker(map);
mLineStyle = new LineStyle(track.style.color, track.style.width, Cap.BUTT);
mRenderer = new RenderPath();
mTrack = track;
updatePoints();
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:9,代码来源:TrackLayer.java
注:本文中的org.oscim.map.Map类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论