当前位置: 首页>>代码示例>>Java>>正文


Java OnInfoWindowClickListener类代码示例

本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener的典型用法代码示例。如果您正苦于以下问题:Java OnInfoWindowClickListener类的具体用法?Java OnInfoWindowClickListener怎么用?Java OnInfoWindowClickListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnInfoWindowClickListener类属于com.google.android.gms.maps.GoogleMap包,在下文中一共展示了OnInfoWindowClickListener类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUpMap

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
private void setUpMap() {
 	mMap.setMyLocationEnabled(true);
     mMap.setOnMyLocationButtonClickListener(this);
    mMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {

@Override
public void onInfoWindowClick(Marker marker) {
	String title = marker.getTitle();
			int resId = mMarkerInfoMap.get(marker).getResId();
	
	Intent intent = new Intent(RoutesMapFragment.this.getActivity(), PointOfInterestActivity.class);
       		intent.putExtra(Constants.INTENT_TITLE, title);
       		intent.putExtra(Constants.INTENT_RES_ID, resId);
   			intent.putExtra(Constants.INTENT_TAB, 1);
   			intent.putExtra(Constants.INTENT_POSITION, mMarkerInfoMap.get(marker).getPosition());
 			intent.putExtra(Constants.INTENT_DRAWER_POSITION, 0);
   			RoutesMapFragment.this.getActivity().startActivity(intent);
}
    	
    });
	
	addDefaultMarkers();
	goToDefaultLocation();
 }
 
开发者ID:iiseagrant,项目名称:ChicagoWaterWalk-Android,代码行数:25,代码来源:RoutesMapFragment.java

示例2: onCreate

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.mapview);
	
	type = getIntent().getStringExtra("type");
	facilities = facilitiesManager.get(getApplicationContext()).getFacilities(type);
	
	facilityMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
	
	facilityMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
		public void onInfoWindowClick(Marker marker){
			Intent i = new Intent(MapActivity.this, facilityInfo.class);
			i.putExtra("facility", facilityMarkers.get(marker));
			i.putExtra("type", type);
			startActivity(i);
		}
	});
	
	Log.i(TAG, "About to add markers for faciltiies");
	for (facility f : facilities) {
		addMarker(f);
	}
	Log.i(TAG, "Finished adding markers.");
	
	setTitle(getMapTitle());
	centerMap();
}
 
开发者ID:rasmi,项目名称:homeless-nyc,代码行数:29,代码来源:MapActivity.java

示例3: setUpMap

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
private void setUpMap() {
 	mMap.setMyLocationEnabled(true);
     mMap.setOnMyLocationButtonClickListener(this);
    mMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {

@Override
public void onInfoWindowClick(Marker marker) {
	Intent intent = new Intent(PointOfInterestMapFragment.this.getActivity(), PointOfInterestDetailActivity.class);
	intent.putExtra(Constants.INTENT_TITLE, marker.getTitle());
	intent.putExtra(Constants.INTENT_RES_ID, mMarkerInfoMap.get(marker).getResId());
	mItemClickedListener.onItemClicked(intent);
}
    	
    });
    
	TypedArray routes = getResources().obtainTypedArray(R.array.routes);
	int resId = routes.getResourceId(getArguments().getInt(INTENT_POSITION), -1);
	routes.recycle();
 	TypedArray route = getResources().obtainTypedArray(resId);
 	
 	mZoom = route.getInteger(2, -1);
 	mDefaultLatitude = route.getFloat(3, -1);
 	mDefaultLongitude = route.getFloat(4, -1);
 	
     addMarkers(route.getResourceId(5, -1));
 	route.recycle();
     goToDefaultLocation();
 }
 
开发者ID:iiseagrant,项目名称:ChicagoWaterWalk-Android,代码行数:29,代码来源:PointOfInterestMapFragment.java

示例4: onMapReady

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
    map = googleMap;

    if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        // TODO: Call ActivityCompat#requestPermissions
        return;
    } else {
        map.setMyLocationEnabled(true);
    }

    Service service = (Service) getIntent().getExtras().getSerializable(Utils.ARGS_SERVICE);
    if (service != null) {
        drawService(service);
    } else {
        new GetMapMarkers().execute();
    }

    map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
        @Override
        public void onInfoWindowClick(Marker marker) {
            Intent intent = new Intent().setClass(getApplicationContext(),
                    StationActivity.class);
            Station station = stationMarkers.get(marker);
            if (station != null) {
                Bundle bundle = new Bundle();
                bundle.putSerializable(Utils.ARGS_STATION, station);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        }
    });

}
 
开发者ID:Train-Track,项目名称:Train-Track-Android,代码行数:35,代码来源:MapActivity.java

示例5: whenInfoWindowClick

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
/**
 * when info window is clicked
 *
 * @param callback
 */
public void whenInfoWindowClick(final MarkerCallback callback) {
    map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
        @Override
        public void onInfoWindowClick(Marker marker) {
            callback.invokedMarker(map, marker);
        }
    });
}
 
开发者ID:kewang,项目名称:map-controller,代码行数:14,代码来源:MapController.java

示例6: setOnInfoWindowClickListener

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
public final void setOnInfoWindowClickListener(OnInfoWindowClickListener listener) {
    map.setOnInfoWindowClickListener(listener);
}
 
开发者ID:mosquitolabs,项目名称:referendum_1o_android,代码行数:5,代码来源:GoogleMapWrapper.java

示例7: onCreateView

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         rootView = inflater.inflate(R.layout.fragment_home, container, false);
         dropMap = new HashMap<Marker, Drop>();
         
         if(!isConnected()) {
         	new AlertDialog.Builder(rootView.getContext())
         		.setTitle("No Connection")
         		.setIcon(android.R.drawable.ic_dialog_alert)
         		.setMessage("Internet not available. You will not be able to see drops. Please check your connectivity and then refresh or reload Drop In.")
         		.setNeutralButton("OK", new DialogInterface.OnClickListener() {
         			@Override
         			public void onClick(DialogInterface dialog, int which) { }
         		})
         		.show();
         }
     	
         // get MapView from layout
         mapView = (MapView) rootView.findViewById(R.id.mapview);
         mapView.onCreate(savedInstanceState);
         //get GoogleMap from MapView + initialization
         map = mapView.getMap();
         MapsInitializer.initialize(mapView.getContext());
         map.setMyLocationEnabled(true);

         int actionBarSize = getActionBarHeight();
         map.setPadding(0, actionBarSize, 0, actionBarSize);
         
         map.getUiSettings().setZoomControlsEnabled(true);
         
         refresh();
     	
     	map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
	@Override
	public void onInfoWindowClick(Marker marker) {
		info = new Info_Fragment(dropMap.get(marker));
		ft = fm.beginTransaction();
		ft.add(R.id.container, info)
		  .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
		  .addToBackStack("info")
		  .commit();
	}
});
         
         return rootView;
     }
 
开发者ID:valesken,项目名称:BecauseWaterAndroid,代码行数:47,代码来源:HomeActivity.java

示例8: setOnInfoWindowClickListener

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
public final void setOnInfoWindowClickListener(OnInfoWindowClickListener listener) {
	map.setOnInfoWindowClickListener(listener);
}
 
开发者ID:mtransitapps,项目名称:mtransit-for-android,代码行数:5,代码来源:GoogleMapWrapper.java

示例9: onCreate

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {

	super.onCreate(savedInstanceState);
	// Activate Navigation Mode Tabs
		mActionBar = getSupportActionBar();
		mActionBar.setDisplayHomeAsUpEnabled(true);
		mActionBar.setTitle("La Poste Tunisienne");
		mActionBar.setSubtitle("Map des bureaux ");

		setContentView(R.layout.layout_map);
		SupportMapFragment frg = new SupportMapFragment();
		frg = (SupportMapFragment) getSupportFragmentManager()
				.findFragmentById(R.id.map);
		map = frg.getMap();

		map.setMapType(GoogleMap.MAP_TYPE_NORMAL);

		// MyLocation enable :
		map.setMyLocationEnabled(true);

		// MyLocation marker
		// LatLng myStartLocation = new
		// LatLng(map.getMyLocation().getLatitude(),
		// map.getMyLocation().getLongitude());

		map.setLocationSource(new CurrentLocationProvider(this));

		// Marker hamburg = map.addMarker(new
		// MarkerOptions().position(Menzah9)
		// .title("Manzah9"));
		kiel = map.addMarker(new MarkerOptions()
				.position(Menzah9).title("Menzah9")
				.snippet("Bureau de Poste"));

		kiel2 = map.addMarker(new MarkerOptions().position(Hached)
				.title("Hached").snippet("Bureau de Poste"));

		Marker kiel3 = map.addMarker(new MarkerOptions().position(Rades)
				.title("Rades").snippet("Bureau de Poste"));

		// Move the camera instantly to hamburg with a zoom of 15.
		map.moveCamera(CameraUpdateFactory.newLatLngZoom(Hached, 21));

		// Zoom in, animating the camera.
		map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);

		// OnMarkerDragListener
		// OnInfoWindowClickListener

		map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {

			@Override
			public void onInfoWindowClick(Marker marker) {

				progressDialog = new ProgressDialog(MapActivity.this,
						ProgressDialog.THEME_HOLO_LIGHT);
				progressDialog.setIndeterminate(false);
				progressDialog
						.setProgressStyle(ProgressDialog.STYLE_SPINNER);
				progressDialog.setMessage(" Telechargement ...");
				progressDialog.show();
				Rechercher("hached");

			}
		});

		mRequestQueue = ((LaPosteTunisienne) getApplicationContext())
				.getVolleyRequestQueue();
		URL = ((LaPosteTunisienne) getApplicationContext()).URL;

	

}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:75,代码来源:MapActivity.java

示例10: onCreateView

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View v = super.onCreateView(inflater, container, savedInstanceState);
	
	hsLocation = new LatLng(40.993498, 29.042059);
	if (getActivity() != null) {
		int checkGooglePlayServices = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity());
	    
		if (checkGooglePlayServices != ConnectionResult.SUCCESS) {
	    // google play services is missing!!!!
	    /* Returns status code indicating whether there was an error. 
	    Can be one of following in ConnectionResult: SUCCESS, SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED, SERVICE_DISABLED, SERVICE_INVALID.
	    */
			Log.e("hs", "play services not available");
			Log.e("hs", String.valueOf(checkGooglePlayServices));
			
	    } else {
    
			CameraPosition camPos = new CameraPosition.Builder()
					.target(hsLocation)
					.zoom(16)
					.build();
			
			CameraUpdate update = CameraUpdateFactory.newCameraPosition(camPos);
			getMap().moveCamera(update);
			
			MarkerOptions mrkr = new MarkerOptions();
			mrkr.position(hsLocation)
				.title("İstanbul HackerSpace")
				.snippet("Click to call - Tel : +90 216 418 04 17")
				.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher));
			
			getMap().addMarker(mrkr);
			
			getMap().setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
		        public void onInfoWindowClick(final Marker marker) {
	        		Intent callIntent = new Intent(Intent.ACTION_CALL);
			        callIntent.setData(Uri.parse("tel:+90 216 418 04 17"));
			        startActivity(callIntent);
		        }
			});
		
			
			getMap().setMyLocationEnabled(true);
		}
	}
	return v;
}
 
开发者ID:istanbulhs,项目名称:istanbul-hackerspace-app,代码行数:50,代码来源:HackerspaceMapFragment.java

示例11: setOnInfoWindowClickListener

import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener; //导入依赖的package包/类
void setOnInfoWindowClickListener(OnInfoWindowClickListener listener); 
开发者ID:mosquitolabs,项目名称:referendum_1o_android,代码行数:2,代码来源:IGoogleMap.java


注:本文中的com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。