Zooms to x, y, r coordinates on the map taken from the {@link DynamicUrlParser}.
352479
private void zoomTo() {

		if (urlParser.isValid() && !zoomedTo) {

			final Timer timer = new Timer() {
				@Override
				public void run() {
					mapWidget.getMapModel().getMapView().setCurrentScale(urlParser.getR(), MapView.ZoomOption.EXACT);
					mapWidget.getMapModel().getMapView().setCenterPosition(new Coordinate(urlParser.getX(),
							urlParser.getY()));

					this.cancel();
					zoomedTo = true;

				}
			};
			//run one time after 0.1s to be sure that the map has been resized.
			timer.schedule(100);
		}
	}
690447
function attachExtensions(root, parent, maps)
  {
    this.root = root;
    this.pointers = [];
    this.parent = parent;
    this.maps = maps;
    Object.defineProperties(this, {
      localmaps: setDescriptorLocalMaps(parent),
      subnodes: setDescriptorSubNodes(parent)
    })
  }
246134
public void setPoint( double x, double y ) {
        if (selection >= 0) {
            Coordinate coordinate = new Coordinate(x, y);
            pts.set(selection, coordinate);
        }
    }
382561
def create_context_plot_zoomed(ra, dec, name="Your object", size=3):
    """"""
    plot = K2FootprintPlot(figsize=(8, 8))
    for c in range(0, 20):
        plot.plot_campaign(c)
    plot.ax.scatter(ra, dec, marker='x', s=250, lw=3, color="red", zorder=500)
    plot.ax.text(ra, dec - 0.05*size, name,
                 ha="center", va="top", color="red",
                 fontsize=20, fontweight='bold', zorder=501)
    plot.ax.set_xlim([ra - size/2., ra + size/2.])
    plot.ax.set_ylim([dec - size/2., dec + size/2.])
    return plot
1221029
protected void defineSmallRectangles(ZoomableGraphicsContext gc, T element) {
		final double ptsSize = element.getPointSize() / 2.;
		final Rectangle2afp<?, ?, ?, ?, ?, ?> visibleArea = gc.getVisibleArea();
		for (final Point2d point : element.points()) {
			if (visibleArea.contains(point)) {
				final double x = point.getX() - ptsSize;
				final double y = point.getY() - ptsSize;
				final double mx = point.getX() + ptsSize;
				final double my = point.getY() + ptsSize;
				gc.moveTo(x, y);
				gc.lineTo(mx, y);
				gc.lineTo(mx, my);
				gc.lineTo(x, my);
				gc.closePath();
			}
		}
	}
456229
protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
		final double ptsSize = element.getPointSize() / 2.;
		final double x = element.getX() - ptsSize;
		final double y = element.getY() - ptsSize;
		final double mx = element.getX() + ptsSize;
		final double my = element.getY() + ptsSize;
		gc.moveTo(x, y);
		gc.lineTo(mx, y);
		gc.lineTo(mx, my);
		gc.lineTo(x, my);
		gc.closePath();
	}
661944
public Point rotateAndScalePoint(int x, int y, Point reuse) {
		return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0);
	}
975207
def snapPointToCanvas(self, x, y):
        
        if x < 0 or x > self.pixmap.width() or y < 0 or y > self.pixmap.height():
            x = max(x, 0)
            y = max(y, 0)
            x = min(x, self.pixmap.width())
            y = min(y, self.pixmap.height())
            return x, y, True

        return x, y, False
405002
public int[] MetersToPixels( double mx, double my, int zoom ) {
        double res = Resolution(zoom);
        int px = (int) Math.round((mx + originShift) / res);
        int py = (int) Math.round((my + originShift) / res);
        return new int[]{px, py};
    }
192529
function () {
        var zoom = this.map.getZoom();
        var extent = this.map.getMaxExtent();
        zoom = zoom - Math.log(this.maxResolution / (this.lzd/512))/Math.log(2);
        return zoom;
    }
1268741
function (e) {
        var scale = this._map.getZoomScale(e.zoom);
        var offset = this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(), e.zoom, e.center);

        L.DomUtil.setTransform(this._canvas, offset, scale);
    }
829130
public void zoomCenteredTo(float zoom, PointF pivot) {
        float dzoom = zoom / this.zoom;
        zoomTo(zoom);
        float baseX = currentXOffset * dzoom;
        float baseY = currentYOffset * dzoom;
        baseX += (pivot.x - pivot.x * dzoom);
        baseY += (pivot.y - pivot.y * dzoom);
        moveTo(baseX, baseY);
    }
730178
function ProjectionHelperOverlay(map) {

  this.setMap(map);

  var TILEFACTOR = 8;
  var TILESIDE = 1 << TILEFACTOR;
  var RADIUS = 7;

  this._map = map;
  this._zoom = -1;
  this._X0 =
  this._Y0 =
  this._X1 =
  this._Y1 = -1;


}
234257
function initializeMap() {
			if($('.map').length) {
				var mapCanvas = $('#map-canvas');
				var myLatlng = new google.maps.LatLng(mapCanvas.data("latitude"),mapCanvas.data("longitude"));
				var mapOptions = {
					zoom: mapCanvas.data("zoom"),
					center: myLatlng
				}
				var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
				
				var marker = new google.maps.Marker({
				  position: myLatlng,
				  map: map
		  	});
			}
		  
		}
34934
def coordinates(self, x, y, **kwargs):
        ''''''
        kwargs['returntype'] = 'geographies'
        fields = {
            'x': x,
            'y': y
        }

        return self._fetch('coordinates', fields, **kwargs)
436827
public boolean isWithinBoundingBox(int x, int y, int zoom) {
        boolean withinBounds = true;

        // If a bounding box is set, check if it overlaps with the request
        if (webMercatorBoundingBox != null) {

            // Get the bounding box of the requested tile
            BoundingBox tileWebMercatorBoundingBox = TileBoundingBoxUtils
                    .getWebMercatorBoundingBox(x, y, zoom);

            // Adjust the bounding box if needed
            BoundingBox adjustedWebMercatorBoundingBox = getWebMercatorBoundingBox(tileWebMercatorBoundingBox);

            // Check if the request overlaps
            withinBounds = adjustedWebMercatorBoundingBox.intersects(
                    tileWebMercatorBoundingBox, true);
        }

        return withinBounds;
    }
222742
def dynamic_zoom_plot(x, y, N, RegionStartSize=1000):
    
    x_lowres = x[::N]
    y_lowres = y[::N]
    
    ax1 = _plt.subplot2grid((2, 1), (0, 0), colspan=1)
    ax2 = _plt.subplot2grid((2, 1), (1, 0))
    
    fig = ax1.get_figure()
    _plt.subplots_adjust(bottom=0.25) # makes space at bottom for sliders
    
    CenterTime0 = len(x)/2
    TimeWidth0 = len(x)/RegionStartSize
    
    l1, = ax1.plot(x_lowres, y_lowres, lw=2, color='red')
    global r1
    r1 = ax1.fill_between(x_lowres[int((CenterTime0 - TimeWidth0)/N) : int((CenterTime0 + TimeWidth0)/N)], min(y), max(y), facecolor='green', alpha=0.5)
    l2, = ax2.plot(x, y, lw=2, color='red')
    
    
    axcolor = 'lightgoldenrodyellow'
    axCenterTime = _plt.axes([0.25, 0.1, 0.65, 0.03], facecolor=axcolor)
    axTimeWidth = _plt.axes([0.25, 0.15, 0.65, 0.03], facecolor=axcolor)
    
    SliderCentreTime = Slider(axCenterTime, 'Center Time', 0, len(x), valinit=CenterTime0)
    SliderTimeWidth = Slider(axTimeWidth, 'Time Width', 0, len(x), valinit=TimeWidth0)
    
    
    def update(val):
        TimeWidth = SliderTimeWidth.val
        CentreTime = SliderCentreTime.val
        LeftIndex = int(CentreTime-TimeWidth)
        if LeftIndex < 0:
            LeftIndex = 0
        RightIndex = int(CentreTime+TimeWidth)
        if RightIndex > len(x)-1:
            RightIndex = len(x)-1
        global r1
        r1.remove()
        r1 = ax1.fill_between(x[LeftIndex:RightIndex], min(y), max(y), facecolor='green', alpha=0.5)
        l2.set_xdata(x[LeftIndex:RightIndex])
        l2.set_ydata(y[LeftIndex:RightIndex])
        ax2.set_xlim([x[LeftIndex], x[RightIndex]])
        fig.canvas.draw_idle()
    SliderCentreTime.on_changed(update)
    SliderTimeWidth.on_changed(update)
    
    resetax = _plt.axes([0.8, 0.025, 0.1, 0.04])
    button = Button(resetax, 'Reset', color=axcolor, hovercolor='0.975')
    
    
    def reset(event):
        SliderCentreTime.reset()
        SliderTimeWidth.reset()
    button.on_clicked(reset)    
    
    _plt.show()