Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. package be.ac.ulb.infof307.g05;
  2.  
  3. import com.lynden.gmapsfx.javascript.event.GMapMouseEvent;
  4. import com.lynden.gmapsfx.javascript.event.MouseEventHandler;
  5.  
  6. public class MapLeftClickHandler implements MouseEventHandler{
  7. private Map map;
  8.  
  9. public MapLeftClickHandler(Map boundMap){
  10. map = boundMap;
  11. }
  12.  
  13. public void handle(GMapMouseEvent event){
  14. //TODO : change so that it creates the shop from UI infos before passing it to create the marker,
  15. //i.e. : id (from db), coordinates, name, infos
  16.  
  17. CustomMarker marker = map.getMarker(event.getLatLong());
  18.  
  19. if (marker == null)
  20. {
  21. System.out.println("==NULL");
  22. Shop shop = new Shop(new GeoCoordinates(event.getLatLong()));
  23. marker = new CustomMarker(shop, map);
  24. }
  25. else
  26. {
  27. System.out.println("!=NULL");
  28. }
  29. InfoPaneFrontend.getInstance().link(this.map) ;
  30. marker.onClick();
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement