com.google.android.maps.GeoPoint Usage, Examples, Demos and Tutorials

…Code Examples of com.google.android.maps.

address,

phoneNumber,

description,

photo,

link,

new GeoPoint(lat, lon),

parkingNumber,

pricePerHour);

break;

case MdService.RESTAURANT:

tmp = new Restaurant( name,

address,

phoneNumber,

description,

photo,

link,

new GeoPoint(lat, lon) );

break;

case MdService.BEAUTY_CENTER:

tmp = new BeautyCenter( name,

address,

phoneNumber,

description,

photo,

link,

new GeoPoint(lat, lon));

break;

case MdService.CLOTHING:

tmp = new Clothing( name,

address,

phoneNumber,

description,

photo,

link,

new GeoPoint(lat, lon));

break;

case MdService.GYM:

tmp = new Gym( name,

address,

phoneNumber,

description,

photo,

link,

new GeoPoint(lat, lon));

break;

}

if(tmp!=null)

DataLoad.add(tmp);

String newLine = file.readLine();

public void draw(Canvas canvas, MapView mapView, boolean shadow){

//super.draw(canvas, mapView, shadow);

String [] pairs = path.split(” “);

String[] lngLat = pairs[0].split(“,”);

try{

this.tmpStartPoint=new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));

}catch(NumberFormatException e){

return;

}

this.tmpEndPoint=tmpStartPoint;

Projection projection = mapView.getProjection();

Paint paint = new Paint();

paint.setAntiAlias(true);

Point point = new Point();

projection.toPixels(tmpStartPoint, point);

paint.setColor(Color.BLUE);

RectF oval=new RectF( point.x – mRadius, point.y – mRadius,

point.x + mRadius, point.y + mRadius);

// start point

canvas.drawOval(oval, paint);

paint.setColor(Color.GREEN);

paint.setStrokeWidth(5);

paint.setAlpha(120);

Point point1 = new Point();

Point point2 = new Point();

for(int i=0;i 0) {

try {

pointId = Integer.parseInt(id);

point = mLocations.getPoint(pointId);

} catch (NumberFormatException e) {

// ignore – no id found

}

}

}

// store orignal point.

orgPoint = new GeoPoint(point.getLatitudeE6(), point.getLongitudeE6());

// prepare controls

view = (MapView) findViewById(R.id.mapview);

MapController controller = view.getController();

controller.setCenter(new GeoPoint(point.getLatitudeE6(), point

.getLongitudeE6()));

// controller.setZoom(9);

controller.setZoom(15);

mEditTags = (MultiWordAutoCompleteTextView) findViewById(R.id.tag);

mapView.displayZoomControls(true);

mc = mapView.getController();

mc.setZoom(7);

mapOverlays = mapView.getOverlays();

zoom= new GeoPoint(

(int) (Double.parseDouble(getCell(“C”+3)) * 1E6),

(int) (Double.parseDouble(getCell(“D”+3)) * 1E6));

mc.animateTo(zoom);

int row =0;

//

String coordinates2[] = {getCell(“C”+2), getCell(“D”+2)};

//double lat = Double.parseDouble(coordinates2[0]);

//double lng = Double.parseDouble(coordinates2[1]);

int numberofmarker =Integer.parseInt(getCell(“M”+2));

for (int j=1;j<=numberofmarker;j++){ row=j+1; point= new GeoPoint( (int) (Double.parseDouble(getCell("C"+row)) * 1E6), (int) (Double.parseDouble(getCell("D"+row)) * 1E6)); mapView.displayZoomControls(true); mc = mapView.getController(); mc.setZoom(7); mapOverlays = mapView.getOverlays(); zoom= new GeoPoint( (int) (Double.parseDouble(getCell("C"+3)) * 1E6), (int) (Double.parseDouble(getCell("D"+3)) * 1E6)); mc.animateTo(zoom); int row =0; // String coordinates2[] = {getCell("C"+2), getCell("D"+2)}; //double lat = Double.parseDouble(coordinates2[0]); //double lng = Double.parseDouble(coordinates2[1]); int numberofmarker =Integer.parseInt(getCell("M"+2)); for (int j=1;j<=numberofmarker;j++){ row=j+1; point= new GeoPoint( (int) (Double.parseDouble(getCell("C"+row)) * 1E6), (int) (Double.parseDouble(getCell("D"+row)) * 1E6)); mapView.displayZoomControls(true); mc = mapView.getController(); mc.setZoom(7); mapOverlays = mapView.getOverlays(); zoom= new GeoPoint( (int) (Double.parseDouble(getCell("C"+3)) * 1E6), (int) (Double.parseDouble(getCell("D"+3)) * 1E6)); mc.animateTo(zoom); int row =0; // String coordinates2[] = {getCell("C"+2), getCell("D"+2)}; //double lat = Double.parseDouble(coordinates2[0]); //double lng = Double.parseDouble(coordinates2[1]); int numberofmarker =Integer.parseInt(getCell("M"+2)); for (int j=1;j<=numberofmarker;j++){ row=j+1; point= new GeoPoint( (int) (Double.parseDouble(getCell("C"+row)) * 1E6), (int) (Double.parseDouble(getCell("D"+row)) * 1E6)); return; } switch (cu.getType()) { case CacheUpdate.TYPE_EXPAND_DOWN: setBottomRight(new GeoPoint(cu.getNewValue(), getRegion() .getBottomRight().getLongitudeE6())); break; case CacheUpdate.TYPE_EXPAND_LEFT: setTopLeft(new GeoPoint(getRegion().getTopLeft().getLatitudeE6(), cu.getNewValue())); break; case CacheUpdate.TYPE_EXPAND_RIGHT: setBottomRight(new GeoPoint(getRegion().getBottomRight() .getLatitudeE6(), cu.getNewValue())); break; case CacheUpdate.TYPE_EXPAND_UP: setTopLeft(new GeoPoint(cu.getNewValue(), getRegion().getTopLeft() .getLongitudeE6())); break; case CacheUpdate.TYPE_FULL_UPDATE: // no-op, but we do understand the update break; return; } switch (cu.getType()) { case CacheUpdate.TYPE_EXPAND_DOWN: setBottomRight(new GeoPoint(cu.getNewValue(), getRegion() .getBottomRight().getLongitudeE6())); break; case CacheUpdate.TYPE_EXPAND_LEFT: setTopLeft(new GeoPoint(getRegion().getTopLeft().getLatitudeE6(), cu.getNewValue())); break; case CacheUpdate.TYPE_EXPAND_RIGHT: setBottomRight(new GeoPoint(getRegion().getBottomRight() .getLatitudeE6(), cu.getNewValue())); break; case CacheUpdate.TYPE_EXPAND_UP: setTopLeft(new GeoPoint(cu.getNewValue(), getRegion().getTopLeft() .getLongitudeE6())); break; case CacheUpdate.TYPE_FULL_UPDATE: // no-op, but we do understand the update break; this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } service.sendSMS("Zooming"); this.sendKeys( "T T T T T" ); Thread.sleep( 2 * 1000 ); service.sendSMS("Scrolling about"); this.mMapView.getController().animateTo( new GeoPoint(52095829, 5118599) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint(52096778, 5125090) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint(52085117, 5128255) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint(52081517, 5121646) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint(52093535, 5116711) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 2 * 1000 ); // Show of the statistics screen this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } this.sendKeys( "DPAD_CENTER" ); Thread.sleep( 2 * 1000 ); Thread.sleep( 2 * 1000 ); sendMessage( "Scrolling about" ); this.mMapView.getController().animateTo( new GeoPoint( 52095829, 5118599 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52096778, 5125090 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52085117, 5128255 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52081517, 5121646 ) ); Thread.sleep( 2 * 1000 ); this.mMapView.getController().animateTo( new GeoPoint( 52093535, 5116711 ) ); Thread.sleep( 2 * 1000 ); this.sendKeys( "G G" ); Thread.sleep( 5 * 1000 ); } Related Class of com.google.android.maps.GeoPoint Copyright © 2011 www.androidadb.com. All rights reserved. All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc. Contact . See also: | | |

Read More Post