• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MapMarker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openstreetmap.gui.jmapviewer.interfaces.MapMarker的典型用法代码示例。如果您正苦于以下问题:Java MapMarker类的具体用法?Java MapMarker怎么用?Java MapMarker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MapMarker类属于org.openstreetmap.gui.jmapviewer.interfaces包,在下文中一共展示了MapMarker类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: JMapViewer

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Creates a new {@link JMapViewer} instance.
 * @param tileCache The cache where to store tiles
 *
 */
public JMapViewer(TileCache tileCache) {
    tileSource = new OsmTileSource.Mapnik();
    tileController = new TileController(tileSource, tileCache, this);
    mapMarkerList = Collections.synchronizedList(new LinkedList<MapMarker>());
    mapPolygonList = Collections.synchronizedList(new LinkedList<MapPolygon>());
    mapRectangleList = Collections.synchronizedList(new LinkedList<MapRectangle>());
    mapMarkersVisible = true;
    mapRectanglesVisible = true;
    mapPolygonsVisible = true;
    tileGridVisible = false;
    setLayout(null);
    initializeZoomSlider();
    setMinimumSize(new Dimension(tileSource.getTileSize(), tileSource.getTileSize()));
    setPreferredSize(new Dimension(400, 400));
    setDisplayPosition(new Coordinate(50, 9), 3);
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:22,代码来源:JMapViewer.java


示例2: getMapSelectedCaches

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
private ArrayList<Geocache> getMapSelectedCaches(Point p1, Point p2)
{
    ArrayList<Geocache> list = new ArrayList<>();
    if (p1 == null || p2 == null)
        return list;

    int x1 = p1.x < p2.x ? p1.x : p2.x;
    int x2 = p1.x >= p2.x ? p1.x : p2.x;
    int y1 = p1.y < p2.y ? p1.y : p2.y;
    int y2 = p1.y >= p2.y ? p1.y : p2.y;

    for (MapMarker mm : mapViewer.getMapMarkerList())
    {
        MapMarkerCache mmc = (MapMarkerCache)mm;
        Point makerPos = mapViewer.getMapPosition(mm.getLat(), mm.getLon());

        if (makerPos != null && makerPos.x >= x1 && makerPos.x <= x2 && makerPos.y >= y1 &&
            makerPos.y <= y2)
        {
            list.add(mmc.getCache());
        }
    }
    return list;
}
 
开发者ID:RoffelKartoffel,项目名称:cmanager,代码行数:25,代码来源:CacheListView.java


示例3: getRadius

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Calculates the position on the map of a given coordinate
 *
 * @param marker MapMarker object that define the x,y coordinate
 * @param p coordinate
 * @return Integer the radius in pixels
 */
public Integer getRadius(MapMarker marker, Point p) {
    if (marker.getMarkerStyle() == MapMarker.STYLE.FIXED)
        return (int) marker.getRadius();
    else if (p != null) {
        Integer radius = getLatOffset(marker.getLat(), marker.getLon(), marker.getRadius(), false);
        radius = radius == null ? null : p.y - radius.intValue();
        return radius;
    } else
        return null;
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:18,代码来源:JMapViewer.java


示例4: paintMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Paint a single marker.
 * @param g Graphics used for painting
 * @param marker marker to paint
 */
protected void paintMarker(Graphics g, MapMarker marker) {
    Point p = getMapPosition(marker.getLat(), marker.getLon(), marker.getMarkerStyle() == MapMarker.STYLE.FIXED);
    Integer radius = getRadius(marker, p);
    if (scrollWrapEnabled) {
        int tilesize = tileSource.getTileSize();
        int mapSize = tilesize << zoom;
        if (p == null) {
            p = getMapPosition(marker.getLat(), marker.getLon(), false);
            radius = getRadius(marker, p);
        }
        marker.paint(g, p, radius);
        int xSave = p.x;
        int xWrap = xSave;
        // overscan of 15 allows up to 30-pixel markers to gracefully scroll off the edge of the panel
        while ((xWrap -= mapSize) >= -15) {
            p.x = xWrap;
            marker.paint(g, p, radius);
        }
        xWrap = xSave;
        while ((xWrap += mapSize) <= getWidth() + 15) {
            p.x = xWrap;
            marker.paint(g, p, radius);
        }
    } else {
        if (p != null) {
            marker.paint(g, p, radius);
        }
    }
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:35,代码来源:JMapViewer.java


示例5: getMapFocusedCache

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
private Geocache getMapFocusedCache(Point p)
{
    int X = p.x + 3;
    int Y = p.y + 3;
    java.util.List<MapMarker> ar = mapViewer.getMapMarkerList();
    Iterator<MapMarker> i = ar.iterator();
    while (i.hasNext())
    {

        MapMarkerCache mapMarker = (MapMarkerCache)i.next();

        Point MarkerPosition = mapViewer.getMapPosition(mapMarker.getLat(), mapMarker.getLon());
        if (MarkerPosition != null)
        {

            int centerX = MarkerPosition.x;
            int centerY = MarkerPosition.y;

            // calculate the radius from the touch to the center of the dot
            double radCircle =
                Math.sqrt((((centerX - X) * (centerX - X)) + (centerY - Y) * (centerY - Y)));


            if (radCircle < 10)
            {
                return mapMarker.getCache();
            }
        }
    }

    return null;
}
 
开发者ID:RoffelKartoffel,项目名称:cmanager,代码行数:33,代码来源:CacheListView.java


示例6: getRadius

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Calculates the position on the map of a given coordinate
 *
 * @param marker MapMarker object that define the x,y coordinate
 * @return Integer the radius in pixels
 */
public Integer getRadius(MapMarker marker, Point p) {
    if(marker.getMarkerStyle() == MapMarker.STYLE.FIXED)
        return (int)marker.getRadius();
    else if(p!=null){
        Integer radius = getLatOffset(marker.getLat(), marker.getRadius(), false);
        radius = radius==null?null:p.y-radius.intValue();
        return radius;
    }else return null;
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:16,代码来源:JMapViewer.java


示例7: paintMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Paint a single marker.
 */
protected void paintMarker(Graphics g, MapMarker marker) {
    Point p = getMapPosition(marker.getLat(), marker.getLon(), marker.getMarkerStyle()==MapMarker.STYLE.FIXED);
    Integer radius = getRadius(marker, p);
    if (scrollWrapEnabled) {
        int tilesize = tileSource.getTileSize();
        int mapSize = tilesize << zoom;
        if (p == null) {
            p = getMapPosition(marker.getLat(), marker.getLon(), false);
            radius = getRadius(marker, p);
        }
        marker.paint(g, p, radius);
        int xSave = p.x;
        int xWrap = xSave;
        // overscan of 15 allows up to 30-pixel markers to gracefully scroll off the edge of the panel
        while ((xWrap -= mapSize) >= -15) {
            p.x = xWrap;
            marker.paint(g, p, radius);
        }
        xWrap = xSave;
        while ((xWrap += mapSize) <= getWidth() + 15) {
            p.x = xWrap;
            marker.paint(g, p, radius);
        }
    } else {
        if (p != null) {
            marker.paint(g, p, radius);
        }
    }
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:33,代码来源:JMapViewer.java


示例8: setMapMarkerList

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Sets the list of {@link MapMarker}s.
 * @param mapMarkerList list of {@link MapMarker}s
 */
public void setMapMarkerList(List<MapMarker> mapMarkerList) {
    this.mapMarkerList = mapMarkerList;
    repaint();
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:9,代码来源:JMapViewer.java


示例9: addMapMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Add a {@link MapMarker}.
 * @param marker map marker to add
 */
public void addMapMarker(MapMarker marker) {
    mapMarkerList.add(marker);
    repaint();
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:9,代码来源:JMapViewer.java


示例10: removeMapMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Remove a {@link MapMarker}.
 * @param marker map marker to remove
 */
public void removeMapMarker(MapMarker marker) {
    mapMarkerList.remove(marker);
    repaint();
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:9,代码来源:JMapViewer.java


示例11: getMapMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
public MapMarker getMapMarker() {
    return mapMarker;
}
 
开发者ID:nordpos,项目名称:nordpos,代码行数:4,代码来源:JMarkerEdit.java


示例12: setMapMarkerList

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
public void setMapMarkerList(List<MapMarker> mapMarkerList) {
    this.mapMarkerList = mapMarkerList;
    repaint();
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:JMapViewer.java


示例13: getMapMarkerList

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
public List<MapMarker> getMapMarkerList() {
    return mapMarkerList;
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:4,代码来源:JMapViewer.java


示例14: addMapMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
public void addMapMarker(MapMarker marker) {
    mapMarkerList.add(marker);
    repaint();
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:JMapViewer.java


示例15: removeMapMarker

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
public void removeMapMarker(MapMarker marker) {
    mapMarkerList.remove(marker);
    repaint();
}
 
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:5,代码来源:JMapViewer.java


示例16: getMapMarkerList

import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; //导入依赖的package包/类
/**
 * Returns the list of {@link MapMarker}s.
 * @return list of {@link MapMarker}s
 */
public List<MapMarker> getMapMarkerList() {
    return mapMarkerList;
}
 
开发者ID:berniejenny,项目名称:MapAnalyst,代码行数:8,代码来源:JMapViewer.java



注:本文中的org.openstreetmap.gui.jmapviewer.interfaces.MapMarker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DescribeAddressesRequest类代码示例发布时间:2022-05-23
下一篇:
Java XSException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap