×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Bastian Venz
Added: Dec 1, 2015 10:10 AM
Modified: Dec 1, 2015 10:10 AM
Views: 5
Tags: no tags
  1. /**
  2.  * Class for GMap Marker usage in MDSAT.
  3.  * <p>
  4.  * @author pascal.perau
  5.  */
  6. public class BoothGmapMarker extends Marker {
  7.  
  8.     private static final Logger LOG = LoggerFactory.getLogger(BoothGmapMarker.class);
  9.    
  10.     @Getter
  11.     @Setter
  12.     private Booth booth;
  13.  
  14.     private final String MARKER_PREFIX = "http://thydzik.com/thydzikGoogleMap/markerlink.php?text=";
  15.  
  16.     private final String MARKER_URL = "http://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=";
  17.  
  18.     public BoothGmapMarker(LatLng latlng, String title, Booth booth) {
  19.         super(latlng, title, booth);
  20.         this.booth = booth;
  21.     }
  22.  
  23.     public void setMarkerColor(Color c) {
  24.         String hexColor = String.format("%06x", c.getRGB() & 0xffffff);
  25.         String inversColor = String.format("%06x", (~c.getRGB()) & 0xffffff);                
  26.         this.setIcon(MARKER_URL + booth.getBoothId() + "|" + hexColor + "|" + inversColor + "&.png");
  27.     }
  28.  
  29.     @Override
  30.     public String toString() {
  31.         return "BoothGmapMarker{" + "boothId=" + booth.getBoothId() + ", MARKER_PREFIX=" + MARKER_PREFIX + ", MARKER_URL=" + MARKER_URL + '}';
  32.     }
  33. }
  34.