Google maps 如何在处理地图上逐个显示标记?
我正在使用谷歌地图可视化一些位置数据。我有几个地方,我需要显示一个又一个像一个人的旅行路径。我尝试使用延迟,程序被冻结。你能给我一个合适的方法来达到这个目的吗?谢谢。试试这个:Google maps 如何在处理地图上逐个显示标记?,google-maps,geolocation,maps,processing,Google Maps,Geolocation,Maps,Processing,我正在使用谷歌地图可视化一些位置数据。我有几个地方,我需要显示一个又一个像一个人的旅行路径。我尝试使用延迟,程序被冻结。你能给我一个合适的方法来达到这个目的吗?谢谢。试试这个: import de.fhpotsdam.unfolding.*; import de.fhpotsdam.unfolding.geo.*; import de.fhpotsdam.unfolding.utils.*; UnfoldingMap map; ArrayList<Location> locatio
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.utils.*;
UnfoldingMap map;
ArrayList<Location> locations = new ArrayList<Location>();
int locationIndex = -1;
void setup() {
size(800, 600);
map = new UnfoldingMap(this);
// Test data. Load your actual data, instead:
locations.add(new Location(53, 0));
locations.add(new Location(12, 50));
}
void draw() {
map.draw();
// Simple animation: Every 60 frames show next location
if (frameCount % 60 == 0) {
// Increase only if more data exists
if (locationIndex < locations.size() - 1) {
locationIndex++;
}
}
// Show all currently visible locations (i.e. 0 - index)
for (int i = 0; i <= locationIndex; i++) {
Location location = locations.get(i);
ScreenPosition pos = map.getScreenPosition(location);
ellipse(pos.x, pos.y, 10, 10);
}
}
import de.fhpotsdam.展开。*;
导入de.fhpotsdam.unfoling.geo.*;
导入de.fhpotsdam.unfoling.utils.*;
展开地图;
ArrayList位置=新的ArrayList();
int locationIndex=-1;
无效设置(){
尺寸(800600);
映射=新的展开映射(此);
//测试数据。加载实际数据,而不是:
位置。添加(新位置(53,0));
位置。添加(新位置(12,50));
}
作废提款(){
map.draw();
//简单动画:每60帧显示下一个位置
如果(帧数%60==0){
//仅当存在更多数据时增加
if(locationIndex 对于(int i=0;如果您愿意,我将展示您的尝试。您能告诉我如何在堆栈溢出中在此处添加引号吗?它显示并错误地指出代码格式不正确。请帮助查看此处:不确定您到底在尝试做什么,最好如v.k.所建议的那样,给出一个示例。当您运行您需要的代码时,我已在此处上载了我的代码将看到所有的标记都立即放置在地图上。这些位置在一个数组中。我需要逐个显示,以便可以将其作为动画显示。谢谢,希望这澄清了我正在尝试做的事情。谢谢。这是我一直在寻找的类似内容。谢谢你的努力。