Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How to use marker's coordinates as variables at Unfolding

$
0
0

Hello people, I'm new to Unfolding and Processing as well, I've been looking through the tutorials at the Unfolding page and everything seems to work fine, so my problem is that I want to create a variable marker (so it can change its location as it runs), I thought of just changing the coordinates in the location to a float type variables but it seems that I'm forgetting something or someting like that.

I would really apreciate your help even though I'm sure it's pretty dumb.

Here's the code I've been trying to run

import de.fhpotsdam.unfolding.*;
  import de.fhpotsdam.unfolding.geo.*;
  import de.fhpotsdam.unfolding.utils.*;
  import de.fhpotsdam.unfolding.marker.*;
  import de.fhpotsdam.unfolding.providers.Google;

UnfoldingMap map;

void setup() {
  size(800, 600);
  map = new UnfoldingMap(this, new Google.GoogleMapProvider());
  MapUtils.createDefaultEventDispatcher(this, map);
  float Lat=8.27;
  float Lon=-62.73;
}

void draw() {
    map.draw();

    Location berlinLocation = map.getLocation(Lat, Lon);
    Marker berlinMarker = new SimplePointMarker(berlinLocation);
    map.addMarker(berlinMarker);

    Location location = map.getLocation(mouseX, mouseY);
    fill(0);
    text(location.getLat() + ", " + location.getLon(), mouseX, mouseY);

}

Viewing all articles
Browse latest Browse all 2896

Trending Articles