当前位置: 首页>>代码示例>>Java>>正文


Java BoundingBox.getLonWest方法代码示例

本文整理汇总了Java中org.osmdroid.util.BoundingBox.getLonWest方法的典型用法代码示例。如果您正苦于以下问题:Java BoundingBox.getLonWest方法的具体用法?Java BoundingBox.getLonWest怎么用?Java BoundingBox.getLonWest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osmdroid.util.BoundingBox的用法示例。


在下文中一共展示了BoundingBox.getLonWest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldBeDrawn

import org.osmdroid.util.BoundingBox; //导入方法依赖的package包/类
/**
 * @param mapBB bounding box of the map view
 * @param mapOrientation orientation of the map view
 * @return true if the overlay should be drawn.
 */
public boolean shouldBeDrawn(BoundingBox mapBB, float mapOrientation){
    if (!mBoundingBoxSet)
        return true;
    if (mBoundingBox == null)
        //null bounding box means overlay is empty, so nothing to draw:
        return false;
    if (mapOrientation != 0.0f)
        //TODO - handle map rotation...
        return true;
    if (mBoundingBox.getLatSouth() > mapBB.getLatNorth()
        || mBoundingBox.getLatNorth() < mapBB.getLatSouth()
        || mBoundingBox.getLonWest() > mapBB.getLonEast()
        || mBoundingBox.getLonEast() < mapBB.getLonWest())
        //completely outside the map view:
        return false;
    return true;
}
 
开发者ID:MKergall,项目名称:osmbonuspack,代码行数:23,代码来源:FolderZOverlay.java

示例2: urlForTagSearchKml

import org.osmdroid.util.BoundingBox; //导入方法依赖的package包/类
/**
 * Build the URL to search for elements having a specific OSM Tag (key=value), within a bounding box. 
 * Similar to {@link #urlForPOISearch}, but here the request is built to retrieve the full geometry. 
 * @param tag
 * @param bb bounding box
 * @param limit max number of results. 
 * @param timeout in seconds
 * @return the url for this request. 
 */
public String urlForTagSearchKml(String tag, BoundingBox bb, int limit, int timeout){
	StringBuilder s = new StringBuilder();
	s.append(mService+"?data=");
	String sBB = "("+bb.getLatSouth()+","+bb.getLonWest()+","+bb.getLatNorth()+","+bb.getLonEast()+")";
	String data = 
		"[out:json][timeout:"+timeout+"];"
		+ "(node["+tag+"]"+sBB+";"
		+ "way["+tag+"]"+sBB+";);"
		+ "out qt geom tags "+ limit + ";"
		+ "relation["+tag+"]"+sBB+";out qt geom body "+ limit+";"; //relation isolated to get geometry with body option
	//TODO: see issue https://github.com/drolbr/Overpass-API/issues/134#issuecomment-58847362
	//When solved, simplify. 
	Log.d(BonusPackHelper.LOG_TAG, "data="+data);
	s.append(URLEncoder.encode(data));
	return s.toString();
}
 
开发者ID:MKergall,项目名称:osmbonuspack,代码行数:26,代码来源:OverpassAPIProvider.java

示例3: urlForPOISearch

import org.osmdroid.util.BoundingBox; //导入方法依赖的package包/类
/**
 * Build the URL to search for elements having a specific OSM Tag (key=value), within a bounding box. 
 * Elements will be OSM nodes, ways and relations. Ways and relations will have no geometry, only their center. <br>
 * Usage: urlForPOISearch("amenity=cinema", map.getBoundingBox(), 200, 30);<br>
 * @param tag OpenStreetMap tag to search. Can be either "key=value", or "key". 
 * @param bb bounding box
 * @param limit max number of results. 
 * @param timeout in seconds
 * @return the url for this request. 
 * @see <a href="http://wiki.openstreetmap.org/wiki/Tags">OSM Tags</a>
 */
public String urlForPOISearch(String tag, BoundingBox bb, int limit, int timeout){
	StringBuilder s = new StringBuilder();
	s.append(mService+"?data=");
	String sBB = "("+bb.getLatSouth()+","+bb.getLonWest()+","+bb.getLatNorth()+","+bb.getLonEast()+")";
	String data = 
		"[out:json][timeout:"+timeout+"];("
		+ "node["+tag+"]"+sBB+";"
		+ "way["+tag+"]"+sBB+";"
		+ "relation["+tag+"]"+sBB+";"
		+ ");out qt center "+ limit + " tags;";
	Log.d(BonusPackHelper.LOG_TAG, "data="+data);
	s.append(URLEncoder.encode(data));
	return s.toString();
}
 
开发者ID:MKergall,项目名称:osmbonuspack,代码行数:26,代码来源:OverpassAPIProvider.java


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