我想做一个记号笔。我使用mac。我试着通过处理来实现这一点。我使用的是展开地图库。但是记号笔没有显示。
此外,我还绘制了一个文本,以了解我的位置。但它没有显示出来。
谢谢你的回答!
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.providers.*;
import de.fhpotsdam.unfolding.marker.*;
UnfoldingMap map;
void setup() {
size(800,600);
map=new UnfoldingMap(this,new Google.GoogleMapProvider());
MapUtils.createDefaultEventDispatcher(this,map);
Location seoulLocation=new Location(37.549,126.989);
map.zoomAndPanTo(seoulLocation,10);
float maxPanningDistance=30; //in km
map.setPanningRestriction(seoulLocation,maxPanningDistance);
SimplePointMarker seoulMarker=new SimplePointMarker(seoulLocation);
//SimplePointMarker dublinMarker=new SimplePointMarker(dublinLocation);
map.addMarkers(seoulMarker);
map.setTweening(true);
}
void draw() {
map.draw();
// position showing
Location location=map.getLocation(mouseX,mouseY);
fill(100);
text(location.getLat()+","+location.getLon(),mouseX,mouseY);
}我试着在draw fucntion.but中显示我的鼠标位置,但没有显示。但是如果我删除"map.draw()",我就可以显示。但我不知道为什么。
发布于 2016-05-06 07:27:35
当我运行你的代码时,这两个东西都出现了。
标记在这里:

您可以放大以更清楚地查看:

同样,我也看到了文本。在此屏幕截图中,我的鼠标正好位于标记的右侧:

如果这不是您所看到的,那么请检查处理编辑器的控制台是否有任何错误。
https://stackoverflow.com/questions/37061535
复制相似问题