Code example for GoogleMap

Methods: addMarker, addPolyline

0
		String geometry = getArguments().getString("geometry");
		String startPosition = getArguments().getString("start");
 
		// add route 
		if (geometry != null && geometry.length() > 0) {
			map.addPolyline(MapObjectFactory.createRoute(geometry));
		} 
 
		// add point of interest 
		if (startPosition != null && startPosition.length() > 0) {
			map.addMarker(MapObjectFactory.createMarker(startPosition));
		} 
	} 
 
	private void setCameraPosition() { 
		String position = startPosition != null && startPosition.length() > 0 ? startPosition
				: geometry;
		if (position != null && position.length() > 0) {
			map.moveCamera(MapObjectFactory.updateCamera(position));
		} 
	}