本文整理汇总了Java中de.fhpotsdam.unfolding.marker.SimplePointMarker类的典型用法代码示例。如果您正苦于以下问题:Java SimplePointMarker类的具体用法?Java SimplePointMarker怎么用?Java SimplePointMarker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimplePointMarker类属于de.fhpotsdam.unfolding.marker包,在下文中一共展示了SimplePointMarker类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createMarker
import de.fhpotsdam.unfolding.marker.SimplePointMarker; //导入依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// 如果需要打印PointFeature中的所有内容,将下一行代码去掉注释
//System.out.println(feature.getProperties());
// 根据给定的PointFeature中的location来创建SimplePointMarker
SimplePointMarker marker = new SimplePointMarker(feature.getLocation());
Object magObj = feature.getProperty("magnitude");
float mag = Float.parseFloat(magObj.toString());
// 下面的示例是使用Procession的color方法来生成代表黄色的整数值
int yellow = color(255, 255, 0);
// TODO : 添加代码,根据地震级别来设计标记的大小和颜色
// 注意在上面定义的2个常量:THRESHOLD_MODERATE和 THRESHOLD_LIGHT
// 可以与这2个值进行比较来确定地震的级别
// 返回marker
return marker;
}
开发者ID:simontangbit,项目名称:CourseCode,代码行数:23,代码来源:EarthquakeCityMap.java
示例2: createMarker
import de.fhpotsdam.unfolding.marker.SimplePointMarker; //导入依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
int yellow = color(255, 255, 0);
int red = color(255, 0, 0);
int blue = color(0, 0, 255);
SimplePointMarker quake = new SimplePointMarker(feature.getLocation());
Object magObj = feature.getProperty("magnitude");
float mag = Float.parseFloat(magObj.toString());
if (mag < THRESHOLD_LIGHT)
{
quake.setColor(blue);
quake.setRadius(6.0f);
}
else if (mag < THRESHOLD_MODERATE)
{
quake.setColor(yellow);
quake.setRadius(9.0f);
}
else
{
quake.setColor(red);
quake.setRadius(12.0f);
}
return quake;
}
开发者ID:PBGraff,项目名称:Coursera_Java_ObjOrientProg,代码行数:30,代码来源:EarthquakeCityMap.java
示例3: createMarker
import de.fhpotsdam.unfolding.marker.SimplePointMarker; //导入依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// finish implementing and use this method, if it helps.
return new SimplePointMarker(feature.getLocation());
}
开发者ID:imranalidigi,项目名称:UCSDUnfoldingMapsMaven,代码行数:6,代码来源:EarthquakeCityMap.java
示例4: createMarker
import de.fhpotsdam.unfolding.marker.SimplePointMarker; //导入依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// Defining some colors
int red = color(255, 0, 0);
int yellow = color(255, 255, 0);
int blue = color(0, 0, 255);
SimplePointMarker marker = new SimplePointMarker(feature.getLocation());
// Getting different properties of the feature
float magnitude = Float.parseFloat(feature.getProperty("magnitude").toString());
/// Styling the marker according to the feature properties
// Higher magnitude earthquakes will have larger SimplePointMarker
// Setting the radiusIncrement according to the magnitudes
// default 5
float radiusIncrement = 5;
// Changing the color according to the magnitude intensity
// high if >= 5.0
// color = red
if (magnitude >= 5.0){
marker.setColor(red);
radiusIncrement = 10;
}
// moderate if >= 4.0 and < 5.0
// color = yellow
else if (magnitude >= 4.0 && magnitude < 5.0){
marker.setColor(yellow);
// defualt radius increment for moderate
}
// minor if < 4.0
// color = blue
else if (magnitude < 4.0){
marker.setColor(blue);
radiusIncrement = 2;
}
marker.setRadius(radiusIncrement + magnitude);
return marker;
}
开发者ID:abdulhannanali,项目名称:UCSDUnfoldingMaps,代码行数:46,代码来源:EarthquakeCityMap.java
注:本文中的de.fhpotsdam.unfolding.marker.SimplePointMarker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论