本文整理汇总了Java中com.google.android.maps.OverlayItem类的典型用法代码示例。如果您正苦于以下问题:Java OverlayItem类的具体用法?Java OverlayItem怎么用?Java OverlayItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OverlayItem类属于com.google.android.maps包,在下文中一共展示了OverlayItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addMarker
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
public void addMarker(final Marker aMarker) {
if (mItemizedOverlay == null) {
mItemizedOverlay = new GoogleItemizedOverlay(mMapView.getContext().getResources().getDrawable(R.drawable.marker_default));
mMapView.getOverlays().add(mItemizedOverlay);
}
final OverlayItem item = new OverlayItem(new GeoPoint((int)(aMarker.latitude*1E6), (int)(aMarker.longitude*1E6)), aMarker.title, aMarker.snippet);
if (aMarker.bitmap != null || aMarker.icon != 0) {
final Drawable drawable = aMarker.bitmap != null
? new BitmapDrawable(mMapView.getResources(), aMarker.bitmap)
: mMapView.getResources().getDrawable(aMarker.icon);
if (aMarker.anchor == Marker.Anchor.CENTER) {
GoogleItemizedOverlay.setOverlayMarkerCentered(item, drawable);
} else {
item.setMarker(drawable);
}}
mItemizedOverlay.addOverlay(item);
}
开发者ID:osmdroid,项目名称:osmdroid,代码行数:19,代码来源:GoogleV1MapWrapper.java
示例2: onFocusChanged
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
public void onFocusChanged(ItemizedOverlay itemizedoverlay, OverlayItem overlayItem) {
try{
//Log.v(TAG, "onFocusChanged(..) called.");
//Log.d(TAG, "focused OverlayItem overlayitem == " + overlayItem );
// Make the selected view visible.
if( null == overlayItem ){
selectAreaItemView.setVisibility(View.GONE);
}else{
// Set the selected view's properties.
selectAreaItemTitleView.setText(overlayItem.getTitle());
selectAreaItemSnippetView.setText(overlayItem.getSnippet());
selectAreaItemView.setVisibility(View.VISIBLE);
// TODO: Add icon image when available.
}
}catch(HandledException h){ // Ignore.
}catch(Exception exp){
Log.e(TAG, "ERR0005W", exp);
ErrorUtil.handleExceptionFinish("ERR0005W", exp, mActivity);
}
}
开发者ID:SpencerRiddering,项目名称:flingtap-done,代码行数:22,代码来源:SelectGlobalPositionPart.java
示例3: onPostExecute
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected void onPostExecute(Location loc) {
//add our overlay
OverlayItem overlay = new OverlayItem(loc.center.asGeoPoint(), loc.name, loc.description);
overlay.setMarker(transparent);
PointOfInterest poi = new PointOfInterest(loc, overlay);
poiMap.put(loc.id, poi);
pois.add(poi);
populate();
//and select it
POILayer.this.animate = animate;
setLastFocusedIndex(pois.indexOf(poi));
onTap(pois.indexOf(poi));
POILayer.this.animate = true;
}
开发者ID:almajeas,项目名称:RHITMobile-Android,代码行数:17,代码来源:POILayer.java
示例4: onCreate
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the location manager
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
UserData.setLocation(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER));
locationListener = new MapLocationListener();
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTime, minMeters, locationListener);
// Find the most recent lat/lon or if none use the default
GeoPoint point = new GeoPoint(UserData.getLatitudeE6(), UserData.getLongitudeE6());
// Move the map view to the point
mapController.animateTo(point);
// Get the overlays and add our GPS point
mapOverlays = mapView.getOverlays();
icon = getResources().getDrawable(R.drawable.icon);
gpsOverlay = new HashMapItemizedOverlay(icon);
overlayItem = new OverlayItem(point, "MyGps", "The current position of my GPS");
gpsOverlay.addOverlay(overlayItem);
mapOverlays.add(gpsOverlay);
}
开发者ID:phishman3579,项目名称:android-openmap-framework,代码行数:29,代码来源:CenteredMapActivity.java
示例5: onLocationChanged
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
public void onLocationChanged(Location location) {
if (location != null) {
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = LocateActivity.this.getResources().getDrawable(R.drawable.curloc);
MapOverlayItem itemizedoverlay = new MapOverlayItem(drawable, LocateActivity.this);
curLoc = new GeoPoint((int) (location.getLatitude() * 1E6), (int) (location.getLongitude() * 1E6));
UserModel.getInstance().setCurrentLocation(curLoc);
if (Math.abs(curLoc.getLatitudeE6() - previousLoc.getLatitudeE6()) > 1E4
&& Math.abs(curLoc.getLongitudeE6() - previousLoc.getLongitudeE6()) > 1E3) {
mapView.getController().animateTo(curLoc);
mapView.getController().setZoom(15);
}
OverlayItem overlayitem = new OverlayItem(curLoc, getString(R.string.me), getString(R.string.my_cur_loc));
itemizedoverlay.addOverlay(overlayitem);
if (previousLocOverlay != null) {
mapOverlays.remove(previousLocOverlay);
}
mapOverlays.add(itemizedoverlay);
previousLocOverlay = itemizedoverlay;
previousLoc = curLoc;
}
}
开发者ID:wpinnoo,项目名称:PharmaApp,代码行数:27,代码来源:LocateActivity.java
示例6: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
public OverlayItem createItem(int i) {
VenueOverlayItem item = (VenueOverlayItem)super.createItem(i);
Stats stats = item.getVenue().getStats();
if (stats != null && stats.getBeenhere() != null && stats.getBeenhere().me()) {
if (DEBUG) Log.d(TAG, "using the beenThereMarker for: " + item.getVenue());
item.setMarker(mBeenThereMarker);
}
return item;
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:11,代码来源:SearchVenuesMapActivity.java
示例7: onTap
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
public void onTap(OverlayItem itemSelected, OverlayItem itemLastSelected, CheckinGroup cg) {
mTappedVenue = cg.getVenue();
mCallout.setTitle(cg.getVenue().getName());
mCallout.setMessage(cg.getDescription());
mCallout.setVisibility(View.VISIBLE);
mMapController.animateTo(new GeoPoint(cg.getLatE6(), cg.getLonE6()));
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:10,代码来源:FriendsMapActivity.java
示例8: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected OverlayItem createItem(int i) {
Tip tip = (Tip)group.get(i);
if (DEBUG) Log.d(TAG, "creating tip overlayItem: " + tip.getVenue().getName());
int lat = (int)(Double.parseDouble(tip.getVenue().getGeolat()) * 1E6);
int lng = (int)(Double.parseDouble(tip.getVenue().getGeolong()) * 1E6);
GeoPoint point = new GeoPoint(lat, lng);
return new TipOverlayItem(point, tip);
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:10,代码来源:TipItemizedOverlay.java
示例9: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected OverlayItem createItem(int i) {
Venue venue = (Venue)group.get(i);
GeoPoint point = GeoUtils.stringLocationToGeoPoint(
venue.getGeolat(), venue.getGeolong());
return new VenueOverlayItem(point, venue, mContext, mRrm);
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:8,代码来源:VenueItemizedOverlayWithIcons.java
示例10: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected OverlayItem createItem(int i) {
Venue venue = (Venue)group.get(i);
if (DEBUG) Log.d(TAG, "creating venue overlayItem: " + venue.getName());
int lat = (int)(Double.parseDouble(venue.getGeolat()) * 1E6);
int lng = (int)(Double.parseDouble(venue.getGeolong()) * 1E6);
GeoPoint point = new GeoPoint(lat, lng);
return new VenueOverlayItem(point, venue);
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:10,代码来源:VenueItemizedOverlay.java
示例11: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected OverlayItem createItem(int i) {
Checkin checkin = (Checkin)group.get(i);
if (DEBUG) Log.d(TAG, "creating checkin overlayItem: " + checkin.getVenue().getName());
int lat = (int)(Double.parseDouble(checkin.getVenue().getGeolat()) * 1E6);
int lng = (int)(Double.parseDouble(checkin.getVenue().getGeolong()) * 1E6);
GeoPoint point = new GeoPoint(lat, lng);
return new CheckinOverlayItem(point, checkin);
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:10,代码来源:CheckinItemizedOverlay.java
示例12: onTap
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
public void onTap(OverlayItem itemSelected, OverlayItem itemLastSelected, Venue venue) {
mTappedVenueId = venue.getId();
mCallout.setTitle(venue.getName());
mCallout.setMessage(venue.getAddress());
mCallout.setVisibility(View.VISIBLE);
mMapController.animateTo(GeoUtils.stringLocationToGeoPoint(
venue.getGeolat(), venue.getGeolong()));
}
开发者ID:Kamshak,项目名称:foursquared,代码行数:11,代码来源:NearbyVenuesMapActivity.java
示例13: MarkersOverlay
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
public MarkersOverlay(ViajaFacilActivity context) {
this(context.getResources().getDrawable(R.drawable.markera));
mContext = context;
/* GeoPoint point1 = new GeoPoint((int)(-34.62671 * 1E6),(int)(-58.380489 * 1E6));
GeoPoint point2 = new GeoPoint((int)(-34.609122 * 1E6),(int)(-58.407869 * 1E6));*/
GeoPoint point1 = new GeoPoint(0, 0);
GeoPoint point2 = new GeoPoint(0, 0);
OverlayItem markerA = new OverlayItem(point1, mContext.getResources().getString(R.string.from), mContext.getResources().getString(R.string.from));
OverlayItem markerB = new OverlayItem(point2, mContext.getResources().getString(R.string.to), mContext.getResources().getString(R.string.to));
setOverlay(markerA, mContext.getResources().getDrawable(R.drawable.markera), ViajaFacilActivity.FROM);
setOverlay(markerB, mContext.getResources().getDrawable(R.drawable.markerb), ViajaFacilActivity.TO);
populate();
}
开发者ID:Hellek1,项目名称:viaja-facil,代码行数:14,代码来源:MarkersOverlay.java
示例14: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected OverlayItem createItem(int index) {
if (index == 0) {
return firstOverlayItem;
} else if (index == 1) {
return secondOverlayItem;
}
return null;
}
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:10,代码来源:ItemizedOverlayTest.java
示例15: addOverlay
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
/**
* Add an item to the overall overlay list
* @param overlay {@link com.google.android.maps.OverlayItem} to be added
* @param marker {@link android.graphics.drawable.Drawable} of this item
*/
public void addOverlay(OverlayItem overlay, Drawable marker)
{
// set marker for this item
overlay.setMarker(boundCenterBottom(marker));
mOverlays.add(overlay);
populate();
}
开发者ID:BlackHawk90,项目名称:myStress,代码行数:13,代码来源:MapViewerOverlay.java
示例16:
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected boolean onTap(int index)
{
OverlayItem item = mOverlays.get(index);
Toast.makeText(myStress, "Measured at : " + item.getTitle() + "\n" + item.getSnippet(), Toast.LENGTH_LONG).show();
return true;
}
开发者ID:BlackHawk90,项目名称:myStress,代码行数:10,代码来源:MapViewerOverlay.java
示例17: onTap
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected boolean onTap(int index) {
OverlayItem item = mOverlays.get(index);
AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
dialog.setTitle(item.getTitle());
dialog.setMessage(item.getSnippet());
dialog.show();
return true;
}
开发者ID:busradar,项目名称:busradar,代码行数:10,代码来源:TestOverlay.java
示例18: createItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
@Override
protected OverlayItem createItem(int i) {
//BusStop b = mOverlays.get(i);
// OverlayItem o = b;
//o = new OverlayItem(new GeoPoint( (int)b.myStop().latitude(), (int)b.myStop().longitude() ), String.valueOf(b.myStop().id()), b.myStop().myName() );
//o.setMarker(b.getMarker(0));
//return b; //(OverlayItem) b;
//double lat = 43.0693926;
//double lon = -89.4024883;
//OverlayItem o = new OverlayItem(new GeoPoint( (int)(lat*1E6), (int)(lon*1E6)), "XX", "YY");
//return o;
return mOverlays.get(i);
}
开发者ID:busradar,项目名称:busradar,代码行数:14,代码来源:StopOverlay.java
示例19: resolveForPerson
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
private void resolveForPerson(ArrayList<OverlayItem> overlayItems) {
personId = ContentUris.parseId(itr.next());
if( personId < 0 ){
// Whoops, bad data! Bail.
Exception exp = (Exception)(new Exception("Missing or incomplete Contacts.People.CONTENT_URI.").fillInStackTrace());
Log.e(TAG, "ERR0001H", exp);
ErrorUtil.handleExceptionNotifyUserAndThrow("ERR0001H", exp, mContext);
}
// ******************************************************
// Find the postal address that the user wants to use
// ******************************************************
// Get a list of the postal addresses
mContactMethodPostalCursor = mContext.getContentResolver().query(ContactMethods.CONTENT_URI,
ContactMethodProjectionGps.CONTACT_METHODS_PROJECTION, // TODO: This won't work for Androic 2.x and above phones.
ContactMethods.PERSON_ID+"=? AND "+ContactMethodsColumns.KIND+"=?",
new String[]{personId.toString(), String.valueOf(Contacts.KIND_POSTAL)},
null);
if(mContactMethodPostalCursor.moveToNext()){
Uri postalContactMethodUri = ContentUris.withAppendedId(ContactMethods.CONTENT_URI, mContactMethodPostalCursor.getInt(ContactMethodProjectionGps.CONTACT_M_ID_INDEX));
mContactData = mContactMethodPostalCursor.getString(ContactMethodProjectionGps.CONTACT_M_DATA_INDEX);
mGeocodeAddressPart.resolveAddressPosition(mContactData, postalContactMethodUri, this);
}else{
mContactMethodPostalCursor.close();
personId = -1l;
if(itr.hasNext()){
resolveForPerson(overlayItems);
}else{
mListener.onOverlayItemsResolved(overlayItems);
}
}
}
开发者ID:SpencerRiddering,项目名称:flingtap-done,代码行数:34,代码来源:ContactLocationOverlayItemsPart.java
示例20: addOverlayItem
import com.google.android.maps.OverlayItem; //导入依赖的package包/类
private void addOverlayItem(ArrayList<OverlayItem> overlayItems, Long personId, int latitudeE6, int longitudeE6, final String contactData) {
final Context context = mContext;
String description = ContactAttachHandler.queryForContactName(context.getContentResolver(), personId);
// TODO: !! description could be null,, is that all right?
overlayItems.add(new PlacemarkNavigatorOverlayItem(new GeoPoint(latitudeE6, longitudeE6),
description,
contactData, mContext));
}
开发者ID:SpencerRiddering,项目名称:flingtap-done,代码行数:11,代码来源:ContactLocationOverlayItemsPart.java
注:本文中的com.google.android.maps.OverlayItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论