Android Projection - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Projection class.

This code example shows how to use the following methods:toScreenLocation
		this.screenPosition = null;
	} 
 
	void buildScreenPosition(Projection projection) {
		if (projection != null && mapPosition != null) {
			screenPosition = projection.toScreenLocation(mapPosition);
		} 
	} 
 
	void setScreenPosition(Point screenPosition) {
		this.screenPosition = screenPosition;
	} 
 
	double getPixelDistanceFrom(BasePoint otherPoint) {
		return Distance.from(screenPosition, otherPoint.screenPosition);
	} 
 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:fromScreenLocation, toScreenLocation
/* 
 * Copyright (C) 2012 The Android Open Source Project 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 */ 
 
package com.example.mapdemo.moltak; 
 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:fromScreenLocation
package com.sapenguins.thecornerapp.supports; 
 
import android.graphics.Point; 
import android.view.View; 
 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.Projection; 
import com.google.android.gms.maps.model.LatLng; 
 
public class ScreenToMap { 
	//	In the rest of this class, we assume that screen is divide into 6x6 grids. 
	//	With the outer grid the buffer zone. So really, we are interest in 4x4 inner 
	//	grid in the map. This class will provide the mechanism to obtain the bounding 
	//	coordinate rectangle of each of these grid. 
	 
	//  So we are really interest in 6x6 grids, starting at row 0, col 0. We want to obtain 
	//  the screen bounding coordinate of these grids first. 
	public static final int NUM_ROW = 6;
	public static final int NUM_COL = 6;
	 

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:fromScreenLocation
package fi.dy.esav.MapTest; 
 
import android.graphics.Bitmap; 
import android.graphics.Bitmap.Config; 
import android.graphics.BitmapFactory; 
import android.graphics.Canvas; 
import android.graphics.Color; 
import android.graphics.Paint; 
import android.graphics.Paint.Style; 
import android.graphics.Point; 
import android.util.Log; 
 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.Projection; 
 
public class CircleFactory { 
	// 1. some variables: 
 
	private static final double EARTH_RADIUS = 6378100.0;

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:fromScreenLocation
package org.g_okuyama.transform.area; 
 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.Projection; 
import com.google.android.gms.maps.model.LatLng; 
 
import android.app.AlertDialog; 
import android.content.Context; 
import android.content.DialogInterface; 
import android.graphics.Bitmap; 
import android.graphics.Canvas; 
import android.graphics.Color; 
import android.graphics.Paint; 
import android.graphics.Path; 
import android.graphics.Point; 
import android.graphics.PorterDuff.Mode; 
import android.location.Location; 
import android.os.Handler; 
import android.util.AttributeSet; 
import android.util.Log; 

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getVisibleRegion
package com.openmap.grupp1.maphandler; 
 
 
 
import com.google.android.gms.maps.CameraUpdate; 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.GoogleMap.OnCameraChangeListener; 
import com.google.android.gms.maps.Projection; 
import com.google.android.gms.maps.GoogleMap.OnMapLongClickListener; 
import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; 
import com.google.android.gms.maps.MapFragment; 
import com.google.android.gms.maps.model.CameraPosition; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.model.LatLngBounds; 
import com.google.android.gms.maps.model.Marker; 
import com.google.android.gms.maps.model.MarkerOptions; 
import com.openmap.grupp1.R; 
import com.openmap.grupp1.PopupandDialogHandler; 
import android.app.Activity; 

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:toScreenLocation
		return projection.getVisibleRegion();
	} 
 
	@Override 
	public Point toScreenLocation(LatLng location) {
		return projection.toScreenLocation(location);
	} 
 
	@Override 
	public Projection getProjection() {
		return projection;
	} 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:fromScreenLocation
			Log.e("","projection was null...");
			return false; 
		} 
		 
		LatLngBounds bounds = projection.getVisibleRegion().latLngBounds;
		LatLng l = projection.fromScreenLocation( p );
		 
		return bounds.contains( l );
	} 
	 
	public static NClusterContainerV2 recalculatePOI(int mergeGridDensity,int mergeDistance, Projection projection,NMarkerList mapOverlay, int viewHeight, int viewWidth) throws Exception{
		int densityX = mergeGridDensity;
		int densityY = mergeGridDensity;
 
		if(mergeGridDensity==0)
			throw new NullPointerException("Density = 0, might be cause of NScreenParameters is not initialized");
		 
 
		NClusterContainerV2 tempClusterContainer = new NClusterContainerV2();
		 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
/* 
 * Copyright 2013 Taeho Kim (jyte82@gmail.com) 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0 
 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android Projection Questions & Answers:

See Code Examples for Android Projection Methods: