本文整理汇总了Java中com.mapbox.mapboxsdk.events.MapListener类的典型用法代码示例。如果您正苦于以下问题:Java MapListener类的具体用法?Java MapListener怎么用?Java MapListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapListener类属于com.mapbox.mapboxsdk.events包,在下文中一共展示了MapListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOverlay
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Add an overlay to this map. If the overlay is already included,
* does nothing. After adding the overlay, invalidates the map to
* redraw it.
* @param overlay
*/
public void addOverlay(final Overlay overlay) {
if (!mOverlayManager.contains(overlay)) {
mOverlayManager.add(overlay);
if (overlay instanceof MapListener) {
addListener((MapListener) overlay);
}
}
invalidate();
}
示例2: removeOverlay
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Remove an overlay from displaying in this map and invalidates
* the map to trigger a redraw.
* @param overlay
*/
public void removeOverlay(final Overlay overlay) {
if (mOverlayManager.contains(overlay)) {
mOverlayManager.remove(overlay);
if (overlay instanceof MapListener) {
removeListener((MapListener) overlay);
}
}
invalidate();
}
示例3: addOverlay
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Add an overlay to this map. If the overlay is already included,
* does nothing. After adding the overlay, invalidates the map to
* redraw it.
*
* @param overlay
*/
public void addOverlay(final Overlay overlay) {
if (!mOverlayManager.contains(overlay)) {
mOverlayManager.add(overlay);
if (overlay instanceof MapListener) {
addListener((MapListener) overlay);
}
}
invalidate();
}
示例4: removeOverlay
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Remove an overlay from displaying in this map and invalidates
* the map to trigger a redraw.
*
* @param overlay
*/
public void removeOverlay(final Overlay overlay) {
if (mOverlayManager.contains(overlay)) {
mOverlayManager.remove(overlay);
if (overlay instanceof MapListener) {
removeListener((MapListener) overlay);
}
}
invalidate();
}
示例5: recomputeCluster
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
public void recomputeCluster() {
if (mListeners.size() > 0) {
final ZoomEvent event = new ZoomEvent(this, mZoomLevel, false);
for (MapListener listener : mListeners) {
listener.onZoom(event);
}
}
}
示例6: addListener
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Add a new MapListener that observes changes in this map.
* @param listener
*/
public void addListener(final MapListener listener) {
if (!mListeners.contains(listener)) {
mListeners.add(listener);
}
}
示例7: removeListener
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Remove a listener object that observed changes in this map.
* @param listener
*/
public void removeListener(MapListener listener) {
if (mListeners.contains(listener)) {
mListeners.remove(listener);
}
}
示例8: scrollTo
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
public void scrollTo(double x, double y) {
if (mScrollableAreaLimit != null) {
final RectF currentLimit = mScrollableAreaLimit;
final double xToTestWith = x;
final double yToTestWith = y;
final float width_2 = this.getMeasuredWidth() / 2;
final float height_2 = this.getMeasuredHeight() / 2;
// Adjust if we are outside the scrollable area
if (currentLimit.width() <= width_2 * 2) {
x = currentLimit.centerX();
} else if (xToTestWith - width_2 < currentLimit.left) {
x = (currentLimit.left + width_2);
} else if (xToTestWith + width_2 > currentLimit.right) {
x = (currentLimit.right - width_2);
}
if (currentLimit.height() <= height_2 * 2) {
y = currentLimit.centerY();
} else if (yToTestWith - height_2 < currentLimit.top) {
y = (currentLimit.top + height_2);
} else if (yToTestWith + height_2 > currentLimit.bottom) {
y = (currentLimit.bottom - height_2);
}
}
if (!isAnimating()) {
float deltaX = (float) (x - mDScroll.x);
float deltaY = (float) (y - mDScroll.y);
mController.offsetDeltaScroll(deltaX, deltaY);
}
mDScroll.set((float) x, (float) y);
final int intX = (int) Math.round(x);
final int intY = (int) Math.round(y);
// make sure the next time someone wants the projection it is the
// correct one!
mProjection = null;
super.scrollTo(intX, intY);
// do callback on listener
if (mListeners.size() > 0) {
final ScrollEvent event = new ScrollEvent(this, intX, intY, mController.currentlyInUserAction());
for (MapListener listener : mListeners) {
listener.onScroll(event);
}
}
}
示例9: addListener
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Add a new MapListener that observes changes in this map.
*
* @param listener
*/
public void addListener(final MapListener listener) {
if (!mListeners.contains(listener)) {
mListeners.add(listener);
}
}
示例10: removeListener
import com.mapbox.mapboxsdk.events.MapListener; //导入依赖的package包/类
/**
* Remove a listener object that observed changes in this map.
*
* @param listener
*/
public void removeListener(MapListener listener) {
if (mListeners.contains(listener)) {
mListeners.remove(listener);
}
}