Prevent marker from repeating horizontally by setting marker drag and adjusting drag behaviour to reset

@param genericMarker
@param <T>
774008
private <T> void setupMarkerFixedNoRepeatHack(GoogleV3Marker<T> genericMarker) {
        final Marker marker1 = genericMarker.getMarker();
        final LatLng[] initialPosition = new LatLng[1];
        marker1.addDragStartHandler(new DragStartMapHandler() {
            @Override
            public void onEvent(DragStartMapEvent dragStartMapEvent) {
                initialPosition[0] = marker1.getPosition();
            }
        });

        marker1.addDragEndHandler(new DragEndMapHandler() {
            @Override
            public void onEvent(DragEndMapEvent dragEndMapEvent) {
                marker1.setPosition(initialPosition[0]);
            }
        });
    }
1229150
protected static <T> CircularElement<T> spillingMarker() {
		@SuppressWarnings("unchecked")
		CircularElement<T> c = (CircularElement<T>) SPILLING_MARKER;
		return c;
	}
687334
public void setMarkersVisible(final boolean VISIBLE) {
        if (null == markersVisible) {
            _markersVisible = VISIBLE;
            fireUpdateEvent(VISIBILITY_EVENT);
        } else {
            markersVisible.set(VISIBLE);
        }
    }
736771
public void setMarkers(final List<Marker> MARKERS) {
        markers.setAll(MARKERS);
        Collections.sort(markers, new MarkerComparator());
        fireUpdateEvent(REDRAW_EVENT);
    }
866098
private void checkMarkupLevel(final int markupLevel) {
        if (markupLevel >= this.matchedMarkupLevels.length) {
            final int newLen = Math.max(markupLevel + 1, this.matchedMarkupLevels.length + MATCHED_MARKUP_LEVELS_LEN);
            final boolean[] newMatchedMarkupLevels = new boolean[newLen];
            Arrays.fill(newMatchedMarkupLevels, false);
            System.arraycopy(this.matchedMarkupLevels, 0, newMatchedMarkupLevels, 0, this.matchedMarkupLevels.length);
            this.matchedMarkupLevels = newMatchedMarkupLevels;
        }
    }
431998
public void checkMismatchedValidatorAnnotation(Field field, Map<String, Class<?>> genericMap) {
        doCheckMismatchedValidatorAnnotation(field, genericMap);
    }
97159
public void setHighlightedDegree(final float highlightedDegree) {
        this.mHighlightedDegree = highlightedDegree;

        mHighlightedMarker = null;
        mHighlightedMarkerPosition = -1;
        // Loop through all markers to see if any of them are highlighted.
        if (mMarkerList != null) {
            final int size = mMarkerList.size();
            for (int i = 0; i < size; i++) {
                final Marker marker = mMarkerList.get(i);
                // Only check the marker if the visibility is not "gone"
                if (marker.getVisibility() != View.GONE) {
                    final boolean markerIsHighlighted = mHighlightedDegree != HIGHLIGHT_NONE && marker.hasInSection(mHighlightedDegree % 360);
                    marker.setHighlighted(markerIsHighlighted);
                    if (markerIsHighlighted) {
                        // Marker is highlighted!
                        mHighlightedMarker = marker;
                        mHighlightedMarkerPosition = i;
                        final boolean highlightAnimationAndAnimateMarker = mIsAnimating && mAnimateMarkersOnHighlightAnimation;
                        final boolean stillAndAnimateMarker = !mIsAnimating && mAnimateMarkersOnStillHighlight;
                        final boolean wantsToAnimateMarker = highlightAnimationAndAnimateMarker || stillAndAnimateMarker;
                        // Animate only if necessary
                        if (wantsToAnimateMarker && !marker.isAnimating()) {
                            marker.animateBounce();
                        }
                    }
                }
                // Continue looping through the rest to reset other markers.
            }
        }
        postInvalidate();
    }
118632
public void setGenericAttachments(java.util.Collection<GenericAttachment> genericAttachments) {
        if (genericAttachments == null) {
            this.genericAttachments = null;
            return;
        }

        this.genericAttachments = new java.util.ArrayList<GenericAttachment>(genericAttachments);
    }
884618
private void setMarkerBitmap() {
        for (markerType = 0; markerType < cluster.getClusterManager().markerIconBmps.size(); markerType++) {
            // Check if the number of items in this cluster is below or equal the limit of the MarkerBitMap
            if (cluster.getItems().size() <= cluster.getClusterManager()
                    .markerIconBmps.get(markerType).getItemMax()) {
                return;
            }
        }
        // set the markerType to maximum value ==> reduce markerType by one.
        markerType--;
    }
1250026
function(marker) {
        var px = this.map.getLayerPxFromLonLat(marker.lonlat);
        if (px == null) {
            marker.display(false);
        } else {
            if (!marker.isDrawn()) {
                var markerImg = marker.draw(px);
                this.div.appendChild(markerImg);
            } else if(marker.icon) {
                marker.icon.moveTo(px);
            }
        }
    }
294799
private void renderMarker(Marker marker, MarkerVector pos)
   {
      float  angle = 0f;
      float  unitsScale;

      statePush();

      // Calculate vector angle
      if (marker.orient != null)
      {
         if (Float.isNaN(marker.orient))  // Indicates "auto"
         {
            if (pos.dx != 0 || pos.dy != 0) {
               angle = (float) Math.toDegrees( Math.atan2(pos.dy, pos.dx) );
            }
         } else {
            angle = marker.orient;
         }
      }
      // Calculate units scale
      unitsScale = marker.markerUnitsAreUser ? 1f : state.style.strokeWidth.floatValue(dpi);

      // "Properties inherit into the <marker> element from its ancestors; properties do not
      // inherit from the element referencing the <marker> element." (sect 11.6.2)
      state = findInheritFromAncestorState(marker);

      Matrix m = new Matrix();
      m.preTranslate(pos.x, pos.y);
      m.preRotate(angle);
      m.preScale(unitsScale, unitsScale);
      // Scale and/or translate the marker to fit in the marker viewPort
      float _refX = (marker.refX != null) ? marker.refX.floatValueX(this) : 0f;
      float _refY = (marker.refY != null) ? marker.refY.floatValueY(this) : 0f;
      float _markerWidth = (marker.markerWidth != null) ? marker.markerWidth.floatValueX(this) : 3f;
      float _markerHeight = (marker.markerHeight != null) ? marker.markerHeight.floatValueY(this) : 3f;

      if (marker.viewBox != null)
      {
         // We now do a simplified version of calculateViewBoxTransform().  For now we will
         // ignore the alignment setting because refX and refY have to be aligned with the
         // marker position, and alignment would complicate the calculations.
         float xScale, yScale;

         xScale = _markerWidth / marker.viewBox.width;
         yScale = _markerHeight / marker.viewBox.height;

         // If we are keeping aspect ratio, then set both scales to the appropriate value depending on 'slice'
         PreserveAspectRatio  positioning = (marker.preserveAspectRatio != null) ? marker.preserveAspectRatio :  PreserveAspectRatio.LETTERBOX;
         if (!positioning.equals(PreserveAspectRatio.STRETCH))
         {
            float  aspectScale = (positioning.getScale() == PreserveAspectRatio.Scale.slice) ? Math.max(xScale,  yScale) : Math.min(xScale,  yScale);
            xScale = yScale = aspectScale;
         }

         //m.preTranslate(viewPort.minX, viewPort.minY);
         m.preTranslate(-_refX * xScale, -_refY * yScale);
         canvas.concat(m);

         // Now we need to take account of alignment setting, because it affects the
         // size and position of the clip rectangle.
         float  imageW = marker.viewBox.width * xScale;
         float  imageH = marker.viewBox.height * yScale;
         float  xOffset = 0f;
         float  yOffset = 0f;
         switch (positioning.getAlignment())
         {
            case xMidYMin:
            case xMidYMid:
            case xMidYMax:
               xOffset -= (_markerWidth - imageW) / 2;
               break;
            case xMaxYMin:
            case xMaxYMid:
            case xMaxYMax:
               xOffset -= (_markerWidth - imageW);
               break;
            default:
               // nothing to do 
                  break;
         }
         // Determine final Y position
         switch (positioning.getAlignment())
         {
            case xMinYMid:
            case xMidYMid:
            case xMaxYMid:
               yOffset -= (_markerHeight - imageH) / 2;
               break;
            case xMinYMax:
            case xMidYMax:
            case xMaxYMax:
               yOffset -= (_markerHeight - imageH);
               break;
            default:
               // nothing to do 
               break;
         }

         if (!state.style.overflow) {
            setClipRect(xOffset, yOffset, _markerWidth, _markerHeight);
         }

         m.reset();
         m.preScale(xScale, yScale);
         canvas.concat(m);
      }
      else
      {
         // No viewBox provided

         m.preTranslate(-_refX, -_refY);
         canvas.concat(m);

         if (!state.style.overflow) {
            setClipRect(0, 0, _markerWidth, _markerHeight);
         }
      }

      boolean  compositing = pushLayer();

      renderChildren(marker, false);

      if (compositing)
         popLayer(marker);

      statePop();
   }
929306
private void setMapTupleValues(Tuple tuple, int position, Object value, AbstractType<?> validator) throws ExecException
    {
        AbstractType<?> keyValidator = ((MapType<?, ?>) validator).getKeysType();
        AbstractType<?> valueValidator = ((MapType<?, ?>) validator).getValuesType();

        int i = 0;
        Tuple innerTuple = TupleFactory.getInstance().newTuple(((Map<?,?>) value).size());
        for(Map.Entry<?,?> entry :  ((Map<Object, Object>)value).entrySet())
        {
            Tuple mapEntryTuple = TupleFactory.getInstance().newTuple(2);
            setTupleValue(mapEntryTuple, 0, cassandraToPigData(entry.getKey(), keyValidator), keyValidator);
            setTupleValue(mapEntryTuple, 1, cassandraToPigData(entry.getValue(), valueValidator), valueValidator);
            innerTuple.set(i, mapEntryTuple);
            i++;
        }
        tuple.set(position, innerTuple);
    }
1257862
public <R extends RequestQueue> R addMarker(String tag, Object... args) {
        Marker marker = new Marker(tag,
                Thread.currentThread().getId(),
                Thread.currentThread().getName(),
                System.nanoTime());
        for (RequestListener.MarkerListener markerListener : markerListeners) {
            markerListener.onMarker(marker, args);
        }
        return (R) this;
    }
564384
protected boolean onMarkerClickDefault(Marker marker, MapView mapView) {
		marker.showInfoWindow();
		if (marker.mPanToView)
			mapView.getController().animateTo(marker.getPosition());
		return true;
	}
196952
function addMarkers(fetchResult) {
                    var items = fetchResult.items,
                        offset = fetchResult.offset,
                        totalCount = fetchResult.totalCount,
                        absoluteIndex = fetchResult.absoluteIndex,
                        atStart = fetchResult.atStart,
                        atEnd = fetchResult.atEnd;

                    if (isNonNegativeNumber(absoluteIndex)) {
                        if (isNonNegativeNumber(totalCount)) {
                            var itemsLength = items.length;
                            if (absoluteIndex - offset + itemsLength === totalCount) {
                                atEnd = true;
                            }
                        }

                        if (offset === absoluteIndex) {
                            atStart = true;
                        }
                    }

                    if (atStart) {
                        items.unshift(startMarker);
                        fetchResult.offset++;
                    }

                    if (atEnd) {
                        items.push(endMarker);
                    }
                }
750062
public void setMarkerType(final MarkerType TYPE) {
        if (null == markerType) {
            _markerType = null == TYPE ? MarkerType.STANDARD : TYPE;
        } else {
            markerType.set(TYPE);
        }
        fireMarkerEvent(TYPE_CHANGED_EVENT);
    }
900812
public PolylineMarkers addPolylineToMapAsMarkers(GoogleMap map,
                                                     PolylineOptions polylineOptions,
                                                     MarkerOptions polylineMarkerOptions,
                                                     PolylineOptions globalPolylineOptions) {

        PolylineMarkers polylineMarkers = new PolylineMarkers(this);

        if (globalPolylineOptions != null) {
            polylineOptions.color(globalPolylineOptions.getColor());
            polylineOptions.geodesic(globalPolylineOptions.isGeodesic());
            polylineOptions.visible(globalPolylineOptions.isVisible());
            polylineOptions.zIndex(globalPolylineOptions.getZIndex());
            polylineOptions.width(globalPolylineOptions.getWidth());
        }

        Polyline polyline = addPolylineToMap(map, polylineOptions);
        polylineMarkers.setPolyline(polyline);

        List<Marker> markers = addPointsToMapAsMarkers(map,
                polylineOptions.getPoints(), polylineMarkerOptions, false);
        polylineMarkers.setMarkers(markers);

        return polylineMarkers;
    }