本文整理汇总了Java中com.esri.ges.core.geoevent.GeoEvent.getAllFields方法的典型用法代码示例。如果您正苦于以下问题:Java GeoEvent.getAllFields方法的具体用法?Java GeoEvent.getAllFields怎么用?Java GeoEvent.getAllFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.ges.core.geoevent.GeoEvent
的用法示例。
在下文中一共展示了GeoEvent.getAllFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlacemarkForTrack
import com.esri.ges.core.geoevent.GeoEvent; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected Placemark createPlacemarkForTrack(GeoEvent geoevent, List<GeoEvent> geoevents, boolean updateMode, String altitudeMode, String styleUrl, String defaultLineStyleId, String lineStyleField)
{
GeoEventDefinition geoEventDefinition = geoevent.getGeoEventDefinition();
String lineStyleId = defaultLineStyleId;
Placemark pm = new Placemark();
// pm.setName(geoevent.getTrackId() + "_track");
pm.setName(getLabelFieldValue(geoevent) + "_track");
if (updateMode)
pm.setTargetId(geoevent.getTrackId() + "_track");
else
pm.setId(geoevent.getTrackId() + "_track");
LineString line = new LineString();
ArrayList<Data> extendedData = new ArrayList<Data>();
Data data;
Object[] attributes = geoevent.getAllFields();
for (int i = 0; i < attributes.length; i++)
{
Object obj = attributes[i];
if (obj != null)
{
FieldDefinition fieldDefinition = geoEventDefinition.getFieldDefinitions().get(i);
String fieldName = fieldDefinition.getName();
if (i == geoevent.getGeoEventDefinition().getGeometryId())
{
line.setExtrude(true);
line.setTessellate(true);
line.setAltitudeMode(altitudeMode);
line.setCoordinates(getTrackLineString(geoevents, true));
}
else if (obj instanceof Date)
{
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss aa");
data = new Data(fieldName, formatter.format((Date) obj));
extendedData.add(data);
}
else
{
String attribute = obj.toString();
if (attribute.contains(","))
attribute = "\"" + attribute + "\"";
data = new Data(fieldName, attribute.toString());
extendedData.add(data);
if (lineStyleField.length() > 0 && lineStyleField.equals(fieldName))
{
lineStyleId = attribute.toString();
}
}
}
}
pm.setStyleUrl(styleUrl + lineStyleId);
pm.setData(extendedData);
pm.setLineString(line);
return pm;
}