APIMethod: removeMarker

Parameters:
marker - {<OpenLayers.Marker>}
176272
function(marker) {
        if (this.markers && this.markers.length) {
            OpenLayers.Util.removeItem(this.markers, marker);
            marker.erase();
        }
    }
165641
function(marker, type) {
        marker = $(marker);

        // Stop all the unnecessary processing
        if (type === 'activate' && marker.hasClass('is-stalked')) {
            return;
        } else if (type === 'deactivate' && !marker.hasClass('is-stalked')) {
            return;
        }

        var options = this.options,
            targetBy = options.targetBy,
            markBy = options.markBy,
            target = this.targets.filter(function() {
                return $(this).attr(targetBy).replace('#', '') === marker.attr(markBy);
            }),
            before,
            after,
            method;

        if (type === 'activate') {
            before = 'activating';
            after = 'activated';
            method = 'addClass';
        } else {
            before = 'deactivating';
            after = 'deactivated';
            method = 'removeClass';
        }

        this.fireEvent(before, [marker, target]);

        marker[method]('is-stalked');
        target[method]('is-active');

        this.fireEvent(after, [marker, target]);
    }
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();
   }
541925
function(marker) {
        this.markers.push(marker);

        if (this.opacity < 1) {
            marker.setOpacity(this.opacity);
        }

        if (this.map && this.map.getExtent()) {
            marker.map = this.map;
            this.drawMarker(marker);
        }
    }
12288
def remove_eoc_marker(self, text, next_text):
        """"""
        if self.cell_marker_start:
            return text

        if self.is_code() and text[-1] == self.comment + ' -':
            # remove end of cell marker when redundant with next explicit marker
            if not next_text or next_text[0].startswith(self.comment + ' + {'):
                text = text[:-1]
                # When we do not need the end of cell marker, number of blank lines is the max
                # between that required at the end of the cell, and that required before the next cell.
                if self.lines_to_end_of_cell_marker and (self.lines_to_next_cell is None or
                                                         self.lines_to_end_of_cell_marker > self.lines_to_next_cell):
                    self.lines_to_next_cell = self.lines_to_end_of_cell_marker
            else:
                # Insert blank lines at the end of the cell
                blank_lines = self.lines_to_end_of_cell_marker
                if blank_lines is None:
                    # two blank lines when required by pep8
                    blank_lines = pep8_lines_between_cells(text[:-1], next_text, self.ext)
                    blank_lines = 0 if blank_lines < 2 else 2
                text = text[:-1] + [''] * blank_lines + text[-1:]

        return text
31220
function (marker) {
			var markerImg;

			// Reset the previously selected marker
			if ( typeof prevSelectedMarkerAfter !== 'undefined' ) {
				prevSelectedMarkerAfter.setIcon( prevSelectedMarkerBefore );
			}

			// Change the selected marker icon
			if (this.settings.selectedMarkerImgDim === null) {
				markerImg = this.markerImage(this.settings.selectedMarkerImg);
			} else {
				markerImg = this.markerImage(this.settings.selectedMarkerImg, this.settings.selectedMarkerImgDim.width, this.settings.selectedMarkerImgDim.height);
			}

			// Save the marker before switching it
			prevSelectedMarkerBefore = marker.icon;

			marker.setIcon( markerImg );

			// Save the marker to a variable so it can be reverted when another marker is clicked
			prevSelectedMarkerAfter = marker;
		}
533125
function markExtension(editor) {
  const ml = new MarkerList();
  const mm = new MarkerManager(ml);
  let wmh, mmh, vmh;

  editor.eventManager.addEventType('markerUpdated');

  if (editor.isViewer()) {
    vmh = new ViewerMarkerHelper(editor.preview);
  } else {
    wmh = new WysiwygMarkerHelper(editor.getSquire());
    mmh = new MarkdownMarkerHelper(editor.getCodeMirror());
  }

  /**
   * getHelper
   * Get helper for current situation
   * @returns {object} helper
   */
  function getHelper() {
    let helper;

    if (editor.isViewer()) {
      helper = vmh;
    } else if (editor.isWysiwygMode()) {
      helper = wmh;
    } else {
      helper = mmh;
    }

    return helper;
  }

  /**
   * Update mark when resizing
   */
  function updateMarkWhenResizing() {
    const helper = getHelper();

    ml.getAll().forEach(marker => {
      helper.updateMarkerWithExtraInfo(marker);
    });

    editor.eventManager.emit('markerUpdated', ml.getAll());
  }

  // We need to update marker after window have been resized
  $(window).on('resize', updateMarkWhenResizing);

  editor.on('removeEditor', () => {
    $(window).off('resize', updateMarkWhenResizing);
  });

  // Reset marker content after set value
  editor.on('setMarkdownAfter', () => {
    const helper = getHelper();
    mm.resetContent(helper.getTextContent());
  });

  /**
   * setValueWithMarkers
   * Set value with markers
   * @param {string} value markdown content
   * @param {object} markerDataCollection marker data that obtain with exportMarkers method
   * @returns {Array.<object>} markers
   */
  editor.setValueWithMarkers = (value, markerDataCollection) => {
    let helper;

    ml.resetMarkers();

    markerDataCollection.forEach(markerData => {
      ml.addMarker(markerData.start, markerData.end, markerData.id);
    });

    editor.setValue(value);

    mm.resetContent(value.replace(FIND_CRLF_RX, ''));

    if (editor.isViewer() || editor.isWysiwygMode()) {
      helper = getHelper();
      mm.updateMarkersByContent(helper.getTextContent());
    } else {
      helper = mmh;
    }

    ml.getAll().forEach(marker => {
      helper.updateMarkerWithExtraInfo(marker);
    });

    editor.eventManager.emit('markerUpdated', ml.getAll());

    return ml.getAll();
  };

  /**
   * getMarker
   * Get markers that have given id
   * @param {string} id id of marker
   * @returns {object}
   */
  editor.getMarker = id => ml.getMarker(id);

  /**
   * getMarkersAll
   * Get all markers
   * @returns {Array.<object>}
   */
  editor.getMarkersAll = () => ml.getAll();

  /**
   * removeMarker
   * Remove marker with given id
   * @param {string} id of marker that should be removed
   * @returns {marker} removed marker
   */
  editor.removeMarker = id => ml.removeMarker(id);

  /**
   * getMarkersData
   * Get marker data to export so you can restore markers next time
   * @returns {object} markers data
   */
  editor.exportMarkers = () => {
    let markersData;

    if (editor.isMarkdownMode()) {
      markersData = ml.getMarkersData();
    } else if (editor.isViewer() || editor.isWysiwygMode()) {
      mm.updateMarkersByContent(editor.getValue().replace(FIND_CRLF_RX, ''));
      markersData = ml.getMarkersData();
      mm.updateMarkersByContent(getHelper().getTextContent());
    }

    return markersData;
  };

  /**
   * selectMarker
   * Make selection with marker that have given id
   * @param {string} id id of marker
   */
  editor.selectMarker = id => {
    const helper = getHelper();
    const marker = editor.getMarker(id);

    if (marker) {
      helper.selectOffsetRange(marker.start, marker.end);
    }
  };

  /**
   * addMarker
   * Add Marker with given id
   * if you pass just id then it uses current selection for marker
   * or you can pass start and end offset for marker
   * @param {number|string} start start offset or id
   * @param {number} end end offset
   * @param {string} id id of marker
   * @returns {object} marker that have made
   */
  editor.addMarker = (start, end, id) => {
    let marker;
    const helper = getHelper();

    if (!id) {
      id = start;
      marker = helper.getMarkerInfoOfCurrentSelection();
    } else {
      marker = {
        start,
        end
      };

      marker = helper.updateMarkerWithExtraInfo(marker);
    }

    if (marker) {
      marker.id = id;
      marker = ml.addMarker(marker);
      ml.sortBy('end');
      editor.eventManager.emit('markerUpdated', [marker]);
    }

    return marker;
  };

  /**
   * clearSelect
   * Clear selection
   */
  editor.clearSelect = () => {
    getHelper().clearSelect();
  };

  if (!editor.isViewer()) {
    editor.on('changeMode', () => {
      editor._updateMarkers();
    });

    editor.on('change', util.debounce(() => {
      editor._updateMarkers();
    }, MARKER_UPDATE_DELAY));

    /**
     * _updateMarkers
     * Update markers with current text content
     */
    editor._updateMarkers = () => {
      const helper = getHelper();

      if (!ml.getAll().length) {
        return;
      }

      mm.updateMarkersByContent(helper.getTextContent());

      ml.getAll().forEach(marker => {
        helper.updateMarkerWithExtraInfo(marker);
      });

      editor.eventManager.emit('markerUpdated', ml.getAll());
    };
  }
}
797056
function(map) {
        if (this.pane && this.pane.parentNode) {
            this.pane.parentNode.removeChild(this.pane);
        }
        OpenLayers.Layer.prototype.removeMap.apply(this, arguments);
    }
465103
public void warn( Marker marker, String msg )
    {
        if( m_delegate.isWarnEnabled() )
        {
            setMDCMarker( marker );
            m_delegate.warn( msg, null );
            resetMDCMarker();
        }
    }
804850
function(map, origin, originPoint) {
			this.writeDebug('originMarker',arguments);

			if (this.settings.originMarker !== true) {
				return;
			}

			var marker,
				originImg = '';

			if (typeof origin !== 'undefined') {
				if (this.settings.originMarkerImg !== null) {
					if (this.settings.originMarkerDim === null) {
						originImg = this.markerImage(this.settings.originMarkerImg);
					}
					else {
						originImg = this.markerImage(this.settings.originMarkerImg, this.settings.originMarkerDim.width, this.settings.originMarkerDim.height);
					}
				}
				else {
					originImg = {
						url: 'https://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png'
					};
				}

				marker = new google.maps.Marker({
					position : originPoint,
					map      : map,
					icon     : originImg,
					draggable: false
				});
			}
		}
1147899
public void remove() {
        if (polyline != null) {
            polyline.remove();
            polyline = null;
        }
        for (Marker marker : markers) {
            marker.remove();
        }
    }
958377
public void info( Marker marker, String msg )
    {
        if( m_delegate.isInfoEnabled() )
        {
            setMDCMarker( marker );
            m_delegate.inform( msg, null );
            resetMDCMarker();
        }
    }
417309
def marker_(self, lat, long, text, pmap, color=None, icon=None):
        
        try:
            xmap = self._marker(lat, long, text, pmap, color, icon)
            return xmap
        except Exception as e:
            self.err(e, self.marker_, "Can not get marker")
711834
function(marker) {
        OpenLayers.Util.removeItem(this.markers, marker);
        if ((marker.div != null) &&
            (marker.div.parentNode == this.div) ) {
            this.div.removeChild(marker.div);    
        }
    }
626590
public void addMarker(final Marker MARKER) {
        if (null == MARKER) return;
        markers.add(MARKER);
        Collections.sort(markers, new MarkerComparator());
        fireUpdateEvent(REDRAW_EVENT);
    }
1260713
def _marker(self, lat, long, text, xmap, color=None, icon=None,
                text_mark=False, style=None):
        
        kwargs = {}
        if icon is not None:
            kwargs["icon"] = icon
        if color is not None:
            kwargs["color"] = color
        if style is None:
            style = "font-size:18pt;font-weight:bold;" + \
                "color:black;border-radius:0.5"
        try:
            xicon1 = folium.Icon(**kwargs)
            if text_mark is True:
                xicon = DivIcon(
                    icon_size=(150, 36),
                    icon_anchor=(0, 0),
                    html='<div style="' + style + '">' + text + '</div>',
                )
                folium.Marker([lat, long], popup=text,
                              icon=xicon).add_to(xmap)
            folium.Marker([lat, long], popup=text,
                          icon=xicon1).add_to(xmap)
            return xmap
        except Exception as e:
            self.err(e, self._marker, "Can not get marker")
1343070
public static void addMarkerAsPolyline(Marker marker, List<Marker> markers) {
        GeoPoint position = marker.getPosition();
        int insertLocation = markers.size();
        if (markers.size() > 1) {
            double[] distances = new double[markers.size()];
            insertLocation = 0;
            distances[0] = SphericalUtil.computeDistanceBetween(position,
                    markers.get(0).getPosition());
            for (int i = 1; i < markers.size(); i++) {
                distances[i] = SphericalUtil.computeDistanceBetween(position,
                        markers.get(i).getPosition());
                if (distances[i] < distances[insertLocation]) {
                    insertLocation = i;
                }
            }

            Integer beforeLocation = insertLocation > 0 ? insertLocation - 1
                    : null;
            Integer afterLocation = insertLocation < distances.length - 1 ? insertLocation + 1
                    : null;

            if (beforeLocation != null && afterLocation != null) {
                if (distances[beforeLocation] > distances[afterLocation]) {
                    insertLocation = afterLocation;
                }
            } else if (beforeLocation != null) {
                if (distances[beforeLocation] >= SphericalUtil
                        .computeDistanceBetween(markers.get(beforeLocation)
                                .getPosition(), markers.get(insertLocation)
                                .getPosition())) {
                    insertLocation++;
                }
            } else {
                if (distances[afterLocation] < SphericalUtil
                        .computeDistanceBetween(markers.get(afterLocation)
                                .getPosition(), markers.get(insertLocation)
                                .getPosition())) {
                    insertLocation++;
                }
            }

        }
        markers.add(insertLocation, marker);
    }