ImageMarker Unfoldingmaps

edited June 2015 in Library Questions

Hi Guys,

I trying to create my own marker using the unfoldingmaps library and I have a class to draw my marker in the map. I don't know what's I'm doing wrong. Could you help me ???

void draw() {
    map.draw();
    Location location = map.getLocation(mouseX, mouseY);
    fill(0);
    text(location.getLat() + ", " + location.getLon(), mouseX, mouseY);
    
    Location berlinLocation = new Location(-31.3252781,-54.0958781);
    Location dublinLocation = new Location(-31.315926,-54.107566);
     
// Create point markers for locations
SimplePointMarker berlinMarker = new SimplePointMarker(berlinLocation);
SimplePointMarker dublinMarker = new SimplePointMarker(dublinLocation);


// Add markers to the map
map.addMarkers(berlinMarker, dublinMarker);
}

public class EarthquakeMarker extends SimplePointMarker {
 
  public EarthquakeMarker( Location berlinMarker) {
    super(berlinMarker);
  }
 
  public void draw(PGraphics pg, float x, float y) {
    pg.pushStyle();
    pg.noStroke();
    pg.fill(200, 200, 0, 100);
    pg.ellipse(x, y, 40, 40);
    pg.fill(255, 100);
    pg.ellipse(x, y, 30, 30);
    pg.popStyle();
  }
}
Tagged:

Answers

Sign In or Register to comment.