本文整理汇总了Java中org.osmdroid.util.BoundingBox.getLatNorth方法的典型用法代码示例。如果您正苦于以下问题:Java BoundingBox.getLatNorth方法的具体用法?Java BoundingBox.getLatNorth怎么用?Java BoundingBox.getLatNorth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.util.BoundingBox
的用法示例。
在下文中一共展示了BoundingBox.getLatNorth方法的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;
}
示例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();
}
示例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();
}