Package de.fhpotsdam.unfolding.examples.marker.imagemarker

Source Code of de.fhpotsdam.unfolding.examples.marker.imagemarker.ImageMarkerApp

package de.fhpotsdam.unfolding.examples.marker.imagemarker;

import processing.core.PApplet;

import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.utils.MapUtils;

/**
* Demonstrates how to use ImageMarkers with different icons. Note, the used icons contain translucent (the shadows) and
* transparent (the inner holes) areas.
*/
public class ImageMarkerApp extends PApplet {

  Location berlinLocation = new Location(52.5f, 13.4f);
  Location veniceLocation = new Location(45.44f, 12.34f);
  Location lisbonLocation = new Location(38.71f, -9.14f);

  UnfoldingMap map;

  public void setup() {
    size(800, 600, OPENGL);

    map = new UnfoldingMap(this);
    map.zoomAndPanTo(new Location(50.26f, 12.1f), 4);
    MapUtils.createDefaultEventDispatcher(this, map);

    ImageMarker imgMarker1 = new ImageMarker(lisbonLocation, loadImage("ui/marker.png"));
    ImageMarker imgMarker2 = new ImageMarker(veniceLocation, loadImage("ui/marker_red.png"));
    ImageMarker imgMarker3 = new ImageMarker(berlinLocation, loadImage("ui/marker_gray.png"));
    map.addMarkers(imgMarker1, imgMarker2, imgMarker3);
  }

  public void draw() {
    map.draw();
  }

}
TOP

Related Classes of de.fhpotsdam.unfolding.examples.marker.imagemarker.ImageMarkerApp

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.