[原][OE][官方例子]osgearth_annotation OE地球添加热点标签
OE代码样例
/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2016 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/ #include <osgEarth/MapNode> #include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/ExampleResources> #include <osgEarthAnnotation/ImageOverlay>
#include <osgEarthAnnotation/CircleNode>
#include <osgEarthAnnotation/RectangleNode>
#include <osgEarthAnnotation/EllipseNode>
#include <osgEarthAnnotation/PlaceNode>
#include <osgEarthAnnotation/LabelNode>
#include <osgEarthAnnotation/LocalGeometryNode>
#include <osgEarthAnnotation/FeatureNode>
#include <osgEarthAnnotation/ModelNode> #include <osgEarthAnnotation/AnnotationEditing>
#include <osgEarthAnnotation/ImageOverlayEditor> #include <osgEarthSymbology/GeometryFactory> #include <osgViewer/Viewer> using namespace osgEarth;
using namespace osgEarth::Annotation;
using namespace osgEarth::Features;
using namespace osgEarth::Util; //------------------------------------------------------------------ int
usage(char** argv)
{
OE_WARN << "Usage: " << argv[] << " <earthfile>" << std::endl;
return -;
} //------------------------------------------------------------------ int
main(int argc, char** argv)
{
osg::Group* root = new osg::Group(); // try to load an earth file.
osg::ArgumentParser arguments(&argc, argv); osgViewer::Viewer viewer(arguments);
viewer.setCameraManipulator(new EarthManipulator()); // load an earth file and parse demo arguments
osg::Node* node = MapNodeHelper().load(arguments, &viewer);
if (!node)
return usage(argv); root->addChild(node); // find the map node that we loaded.
MapNode* mapNode = MapNode::findMapNode(node);
if (!mapNode)
return usage(argv); // Group to hold all our annotation elements.
osg::Group* annoGroup = new osg::Group();
root->addChild(annoGroup); // Make a group for labels
osg::Group* labelGroup = new osg::Group();
annoGroup->addChild(labelGroup); osg::Group* editGroup = new osg::Group();
root->addChild(editGroup); // Style our labels:
Style labelStyle;
labelStyle.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_CENTER;
labelStyle.getOrCreate<TextSymbol>()->fill()->color() = Color::Yellow; // A lat/long SRS for specifying points.
const SpatialReference* geoSRS = mapNode->getMapSRS()->getGeographicSRS(); //-------------------------------------------------------------------- // A series of place nodes (an icon with a text label)
{
Style pm;
pm.getOrCreate<IconSymbol>()->url()->setLiteral("E:/temp/OE/placemark32.png");
pm.getOrCreate<IconSymbol>()->declutter() = true;
pm.getOrCreate<TextSymbol>()->halo() = Color("#5f5f5f"); // bunch of pins:
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -74.00, 40.71), "New York", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -77.04, 38.85), "Washington, DC", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -118.40, 33.93), "Los Angeles", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -71.03, 42.37), "Boston", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -157.93, 21.35), "Honolulu", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, 139.75, 35.68), "Tokyo", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -90.25, 29.98), "New Orleans", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -80.28, 25.82), "Miami", pm));
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -117.17, 32.72), "San Diego", pm)); // test with an LOD:
osg::LOD* lod = new osg::LOD();
lod->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, 14.68, 50.0), "Prague", pm), 0.0, 2e6);
labelGroup->addChild(lod); // absolute altitude:
labelGroup->addChild(new PlaceNode(mapNode, GeoPoint(geoSRS, -87.65, 41.90, , ALTMODE_ABSOLUTE), "Chicago", pm));
} //-------------------------------------------------------------------- // a box that follows lines of latitude (rhumb line interpolation, the default)
{
Geometry* geom = new Polygon();
geom->push_back(osg::Vec3d(, , ));
geom->push_back(osg::Vec3d(-, , ));
geom->push_back(osg::Vec3d(-, , ));
geom->push_back(osg::Vec3d(, , )); Feature* feature = new Feature(geom, geoSRS);
feature->geoInterp() = GEOINTERP_RHUMB_LINE; Style geomStyle;
geomStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::Cyan;
geomStyle.getOrCreate<LineSymbol>()->stroke()->width() = 5.0f;
geomStyle.getOrCreate<LineSymbol>()->tessellationSize() = ;
geomStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
geomStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU; FeatureNode* fnode = new FeatureNode(mapNode, feature, geomStyle); annoGroup->addChild(fnode); labelGroup->addChild(new LabelNode(mapNode, GeoPoint(geoSRS, -, ), "Rhumb line polygon", labelStyle));
} //-------------------------------------------------------------------- // another rhumb box that crosses the antimeridian
{
Geometry* geom = new Polygon();
geom->push_back(-., -.);
geom->push_back(., -.);
geom->push_back(., -.);
geom->push_back(-., -.);
Style geomStyle; Feature* feature = new Feature(geom, geoSRS);
feature->geoInterp() = GEOINTERP_RHUMB_LINE; geomStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::Lime;
geomStyle.getOrCreate<LineSymbol>()->stroke()->width() = 3.0f;
geomStyle.getOrCreate<LineSymbol>()->tessellationSize() = ;
geomStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
geomStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU; FeatureNode* gnode = new FeatureNode(mapNode, feature, geomStyle);
annoGroup->addChild(gnode); labelGroup->addChild(new LabelNode(mapNode, GeoPoint(geoSRS, -, -), "Antimeridian polygon", labelStyle));
} //-------------------------------------------------------------------- // A path using great-circle interpolation.
// Keep a pointer to it so we can modify it later on.
FeatureNode* pathNode = ;
{
Geometry* path = new LineString();
path->push_back(osg::Vec3d(-, 40.714, )); // New York
path->push_back(osg::Vec3d(139.75, 35.68, )); // Tokyo Feature* pathFeature = new Feature(path, geoSRS);
pathFeature->geoInterp() = GEOINTERP_GREAT_CIRCLE; Style pathStyle;
pathStyle.getOrCreate<LineSymbol>()->stroke()->color() = Color::White;
pathStyle.getOrCreate<LineSymbol>()->stroke()->width() = 1.0f;
pathStyle.getOrCreate<LineSymbol>()->tessellationSize() = ;
pathStyle.getOrCreate<PointSymbol>()->size() = ;
pathStyle.getOrCreate<PointSymbol>()->fill()->color() = Color::Red;
pathStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
pathStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_GPU; //OE_INFO << "Path extent = " << pathFeature->getExtent().toString() << std::endl; pathNode = new FeatureNode(mapNode, pathFeature, pathStyle);
annoGroup->addChild(pathNode); labelGroup->addChild(new LabelNode(mapNode, GeoPoint(geoSRS, -, 61.2), "Great circle path", labelStyle));
} //-------------------------------------------------------------------- // Two circle segments around New Orleans.
{
Style circleStyle;
circleStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Cyan, 0.5);
circleStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
circleStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE; CircleNode* circle = new CircleNode(
mapNode,
GeoPoint(geoSRS, -90.25, 29.98, ., ALTMODE_RELATIVE),
Distance(, Units::KILOMETERS),
circleStyle, Angle(-45.0, Units::DEGREES), Angle(45.0, Units::DEGREES), true);
annoGroup->addChild(circle); editGroup->addChild(new CircleNodeEditor(circle));
} {
Style circleStyle;
circleStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Red, 0.5);
circleStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
circleStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE; CircleNode* circle = new CircleNode(
mapNode,
GeoPoint(geoSRS, -90.25, 29.98, ., ALTMODE_RELATIVE),
Distance(, Units::KILOMETERS),
circleStyle, Angle(45.0, Units::DEGREES), Angle(360.0 - 45.0, Units::DEGREES), true);
annoGroup->addChild(circle); editGroup->addChild(new CircleNodeEditor(circle));
} //-------------------------------------------------------------------- // An extruded ellipse around Miami.
{
Style ellipseStyle;
ellipseStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Orange, 0.75);
ellipseStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
EllipseNode* ellipse = new EllipseNode(
mapNode,
GeoPoint(geoSRS, -80.28, 25.82, 0.0, ALTMODE_RELATIVE),
Distance(, Units::MILES),
Distance(, Units::MILES),
Angle(, Units::DEGREES),
ellipseStyle,
Angle(45.0, Units::DEGREES),
Angle(360.0 - 45.0, Units::DEGREES),
true);
annoGroup->addChild(ellipse); editGroup->addChild(new EllipseNodeEditor(ellipse));
}
{
Style ellipseStyle;
ellipseStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Blue, 0.75);
ellipseStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
EllipseNode* ellipse = new EllipseNode(
mapNode,
GeoPoint(geoSRS, -80.28, 25.82, 0.0, ALTMODE_RELATIVE),
Distance(, Units::MILES),
Distance(, Units::MILES),
Angle(, Units::DEGREES),
ellipseStyle,
Angle(-40.0, Units::DEGREES),
Angle(40.0, Units::DEGREES),
true);
annoGroup->addChild(ellipse); editGroup->addChild(new EllipseNodeEditor(ellipse));
} //-------------------------------------------------------------------- {
// A rectangle around San Diego
Style rectStyle;
rectStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::Green, 0.5);
rectStyle.getOrCreate<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
rectStyle.getOrCreate<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;
RectangleNode* rect = new RectangleNode(
mapNode,
GeoPoint(geoSRS, -117.172, 32.721),
Distance(, Units::KILOMETERS),
Distance(, Units::KILOMETERS),
rectStyle);
annoGroup->addChild(rect); editGroup->addChild(new RectangleNodeEditor(rect));
} //-------------------------------------------------------------------- // An extruded polygon roughly the shape of Utah. Here we demonstrate the
// FeatureNode, where you create a geographic geometry and use it as an
// annotation.
{
Geometry* utah = new Polygon();
utah->push_back(-114.052, 37.0);
utah->push_back(-109.054, 37.0);
utah->push_back(-109.054, 41.0);
utah->push_back(-111.040, 41.0);
utah->push_back(-111.080, 42.059);
utah->push_back(-114.080, 42.024); Style utahStyle;
utahStyle.getOrCreate<ExtrusionSymbol>()->height() = 250000.0; // meters MSL
utahStyle.getOrCreate<PolygonSymbol>()->fill()->color() = Color(Color::White, 0.8); Feature* utahFeature = new Feature(utah, geoSRS);
FeatureNode* featureNode = new FeatureNode(mapNode, utahFeature, utahStyle);
annoGroup->addChild(featureNode);
} //-------------------------------------------------------------------- // an image overlay.
{
ImageOverlay* imageOverlay = 0L;
osg::Image* image = osgDB::readImageFile("E:/temp/OE/placemark32.png/USFLAG.TGA");
//osg::Image* image = osgDB::readImageFile("../data/USFLAG.TGA"); if (image)
{
imageOverlay = new ImageOverlay(mapNode, image);
imageOverlay->setBounds(Bounds(-100.0, 35.0, -90.0, 40.0));
annoGroup->addChild(imageOverlay); editGroup->addChild(new ImageOverlayEditor(imageOverlay));
}
} //-------------------------------------------------------------------- // a model node with auto scaling.
{
Style style;
style.getOrCreate<ModelSymbol>()->autoScale() = true;
style.getOrCreate<ModelSymbol>()->url()->setLiteral("E:/temp/OE/red_flag.osg.50.scale");
ModelNode* modelNode = new ModelNode(mapNode, style);
modelNode->setPosition(GeoPoint(geoSRS, -, ));
annoGroup->addChild(modelNode);
} //-------------------------------------------------------------------- // initialize the viewer:
viewer.setSceneData(root); viewer.getCamera()->setSmallFeatureCullingPixelSize(-1.0f);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = ;
traits->y = ;
traits->width = ;
traits->height = ;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = ; osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(, , traits->width, traits->height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);
viewer.addSlave(camera); return viewer.run();
}
earth文件样例为 : annotation.earth
<!--
osgEarth Sample - Annotations
-->
<map name="readymap.org" type="geocentric" version=""> <image name="ReadyMap.org - Imagery" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.//</url>
</image> <elevation name="ReadyMap.org - Elevation" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.//</url>
</elevation> <viewpoints>
<viewpoint name="Annotation Samples"
lat="" long="-118" range=""
heading="35.27" pitch="-35" />
</viewpoints> <!--annotations name="Annotations Group A"> <label text="Label">
<position lat="" long="-120" />
<style type="text/css">
text-align: center_center;
text-size: ;
text-declutter: true;
text-halo: #;
text-bbox-fill: #00FF0033;
text-bbox-margin: ;
text-bbox-border: #FFFFFFFF;
text-bbox-border-width: ;
</style>
</label> <label text="Label with offsets">
<position lat="" long="-120" />
<style type="text/css">
text-align: center_center;
text-size: ;
text-declutter: true;
text-halo: #;
text-offset-x: ;
text-offset-y: -;
text-bbox-fill: #00FF0033;
text-bbox-margin: ;
text-bbox-border: #FFFFFFFF;
text-bbox-border-width: ;
</style>
</label> <place text="Place">
<position lat="" long="-110"/>
<icon>../data/placemark32.png</icon>
<style type="text/css">
text-declutter: true;
text-halo: #;
</style>
</place> <place text="Extruded Place">
<position lat="" long="-105" alt=""/>
<icon>../data/placemark32.png</icon>
<style type="text/css">
text-declutter: true;
text-halo: #;
</style>
</place> <circle name="draped circle">
<position lat="34.051" long="-117.974"/>
<radius>50km</radius>
<style type="text/css">
fill: #ffff0080;
stroke: #ffffff;
stroke-width: 2px;
altitude-clamping: terrain-drape;
</style>
</circle>
<label text="Draped circle" lat="34.051" long="-117.974"/> <circle name="scene-clamped circle">
<position lat="22.074" long="-159.606"/>
<radius>.2km</radius>
<style type="text/css">
stroke: #ffffff;
stroke-width: 2px;
altitude-clamping: terrain-scene;
altitude-binding: vertex;
render-depth-offset-auto: true;
</style>
</circle>
<label text="scene-clamped circle" lat="22.074" long="-159.606"/> <ellipse name="ellipse relative">
<position lat="" long="-100" hat=""/>
<radius_major>50km</radius_major>
<radius_minor>40km</radius_minor>
<style type="text/css">
fill: #ff00ff7f;
stroke: #ffffff;
</style>
</ellipse>
<label text="HAT Ellipse" lat="" long="-100.0"/>
</annotations> <annotations name="Annotations Group B"> <ellipse name="ellipse extruded">
<position lat="" long="-100.0"/>
<radius_major>50km</radius_major>
<radius_minor>20km</radius_minor>
<style type="text/css">
fill: #ff7f007f;
stroke: #ff0000ff;
extrusion-height: ;
</style>
</ellipse>
<label text="Extruded Ellipse" lat="" long="-100.0"/> <feature name="Extruded Line">
<srs>wgs84</srs>
<geometry>
LINESTRING(-80.37 34.039, -80.09 33.96, -79.75 , -79.43 33.37, -79.48 32.88)
</geometry>
<style type="text/css">
fill: #ff00ff7f;
stroke: #ffff00;
stroke-width: ;
stroke-crease-angle: 45.0;
extrusion-height: ;
render-lighting: true;
</style>
</feature>
<label text="Extruded Line" lat="" long="-80"/> <feature name="GPU-Clamped Line">
<srs>wgs84</srs>
<geometry>
LINESTRING(- , - , - , - )
</geometry>
<style type="text/css">
stroke: #ff3000;
stroke-width: ;
stroke-tessellation-size: 1km;
altitude-clamping: terrain-gpu;
</style>
</feature>
<label text="GPU-Clamped Line" lat="" long="-115">
<style type="text/css">
text-align: center_center;
text-geographic-course: 45.0;
text-bbox-fill: #FFFF0033;
text-bbox-margin: ;
text-bbox-border: #FFFF00;
text-bbox-border-width: 0.5;
</style>
</label> <feature name="Draped Polygon">
<srs>wgs84</srs>
<geometry>
POLYGON((- , - , - , - , - ))
</geometry>
<style type="text/css">
fill: #ffff007f;
stroke: #ffffff;
stroke-width: 2px;
altitude-clamping: terrain-drape;
</style>
</feature>
<label text="Draped Polygon" lat="" long="-98"/> <model name="Auto-Scaled Model">
<position lat="" long="-100"/>
<style>
model: "../data/red_flag.osg.45.scale";
model-scale: auto;
</style>
</model>
<label text="Auto-Scaled Model" lat="42.5" long="-100"/> <imageoverlay>
<url>../data/fractal.png</url>
<alpha>1.0</alpha>
<geometry>POLYGON((- , -80.5 , -80.5 26.5, - 26.5))</geometry>
</imageoverlay>
<label text="ImageOverlay" lat="" long="-81"/> <local_geometry name="3D geometry">
<geometry>
POLYGON(( , - , , ))
</geometry>
<position lat="33.4" long="-116.6"/>
<style type="text/css">
fill: #00ff00;
stroke: #ffff00;
stroke-width: 2px;
render-lighting: false;
</style>
<horizon_culling>true</horizon_culling>
</local_geometry>
<label text="3D Geometry" lat="33.4" long="-116.6"/> <feature name="Long Line">
<srs>wgs84</srs>
<geometry>
LINESTRING( , )
</geometry>
<style type="text/css">
stroke: #ffff00;
stroke-width: ;
stroke-tessellation-size: 1km;
altitude-clamping: terrain;
altitude-technique: gpu;
render-lighting: false;
</style>
</feature> <label text="Tessellated line" lat="" long="">
<style type="text/css">
text-align: center_bottom;
text-geographic-course: ;
</style>
</label> </annotations-->
</map>
[原][OE][官方例子]osgearth_annotation OE地球添加热点标签的更多相关文章
- [原][OE][官方例子]osgearth_features OE地球添加shp文件(特征标识)
OE所有官方样例 官方示例代码 /* -*-c++-*- */ /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph * Co ...
- Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图
Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图 在本节中,您需要修改HelloWorldController类,从而使用视图模板文件,干净优雅的封装生成返回到客户端浏览器HTML ...
- Java Restful框架:Jersey入门示例(官方例子)
本文主要介绍了Java Restful框架Jersey入门例子(来源于官方网站https://jersey.java.net/),废话不多说进入正题. 在Jersey官方示例中(https://jer ...
- Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型
Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型 在这一节中,你将添加用于管理数据库中电影的类.这些类是ASP.NET MVC应用程序的模型部分. 你将使用.NET Framewo ...
- 解析苹果的官方例子LazyTableImages实现图片懒加载原理
解析苹果的官方例子LazyTableImages实现图片懒加载原理 首先在官网下载源码: https://developer.apple.com/library/ios/navigation/#sec ...
- dedecms:织梦文章如何添加“自定义属性”标签(sql命令行工具)
dede织梦如何添加“自定义属性”标签“症状” 1.进入后台——系统——SQL命令行工具——运行SQL命令行,添加arcatt表字段: insert into`dede_arcatt`(sortid, ...
- Discuz 3.X 门户文章插入图片自动添加 alt 标签
最近用 Discuz 搭建了个网站--儿童安全座椅网(www.bbseat.com.cn),用到了门户功能,不得不说Discuz 的功能还是非常强大的,但在使用过程中发现在发表文章时添加了图片却不能像 ...
- Asp.net 后台添加Meta标签方法
Asp.net 后台添加Meta标签方法包括keywords,CSS.JS 下面是从Asp.net 后台添加CSS.JS.Meta标签的写法,我们这里写成函数方便以后使用.如果函数放在页面类中, Pa ...
- 详解Android ActionBar之二:ActionBar添加Tabs标签和下拉导航
本节主要讲解ActionBar如何添加Tabs标签和下拉导航. 一.添加标签 Tabs 在ActionBar中实现标签页可以实现android.app.ActionBar.TabListener ,重 ...
随机推荐
- linux 下安装node 并使用nginx做域名绑定
#1 ,home目录下 下载nodejs安装包,解压 并修改文件夹名称 wget https://nodejs.org/dist/v8.11.4/node-v8.11.4-linux-x64.tar. ...
- gsoup webservice
SoapUI调用webservice实现的两种方式 gsoup https://blog.csdn.net/zhuzhihai1988/article/details/8131370
- Alpha冲刺随笔七:第七天
课程名称:软件工程1916|W(福州大学) 作业要求:项目Alpha冲刺(十天冲刺) 团队名称:葫芦娃队 作业目标:在十天冲刺里对每天的任务进行总结. 随笔汇总:https://www.cnblogs ...
- python_requests ~爬虫~小视频~~~
当一只小小的Py_Spider也有一段时间了, 期间,更多的时间是在爬取图片啊, 文字, 文档这类的东西, 今天突然一时兴起, 来爬一手视频! 所以就找到了远近闻名的六间房(六扇门)哈哈,~~~ 1. ...
- linux 登录后有时候会出现-bash-4.1$
转载自https://blog.csdn.net/jiedao_liyk/article/details/78470498 linux登录后有时候会出现-bash-4.1$ 造成这样的原因: 与这个用 ...
- 配置django的环境实现外部脚本调用django中的模型类
通过导入os模块,os设置django的settings文件,配置好django项目的环境,然后执行django.set_up()使环境生效,然后就可以导入模型类,使用增删改查
- samba 配置参数详解
samba 配置参数详解: 一.全局配置参数 workgroup = WORKGROUP说明:设定 Samba Server 所要加入的工作组或者域. server string = Samba S ...
- P5590 【赛车游戏】
果然我还是太\(Naive\)了 首先有一些点/边其实是没有意义的,如果从1出发不能到该点或者从该点不能到n,这个点就可以不用管了.这个过程可以用正反两边\(dfs/bfs\)实现 然后删掉那些点之后 ...
- sudo 命令
su命令和su -命令最大的本质区别就是: 前者只是切换了root身份,但Shell环境仍然是普通用户的Shell: 而后者连用户和Shell环境一起切换成root身份了.只有切换了Shell环境才不 ...
- 用avalon框架怎么做轮播图?
avalon这个框架其实特别的小众,做个轮播图呢?在github上的例子只有一个,而且功能特别的少,有的引入的插件与avalon里面的指令又不兼容,所以找了一个owl-carousel,目前实现了移动 ...