I have for a while been trying to make a custom info window that shows sensor data. My problem before was that I never solved how to make different info windows for different markers. All markers info windows were updated with the new data.
So in order to get around this problem I was thinking about using the original info window.
My code looks like
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
markerOptions.title("co: " +String.valueOf(co_mV) + " mV");
markerOptions.snippet("no2: " + String.valueOf(co_mV) + " mV");
Is it possible to make the snippet bold or title not bold without creating your own info window? Because this would solve my problem.
Thanks.
EDIT Tried using custom info windwow. This made it so that all markers info windows were updated when I got new data.
protected synchronized void buildGoogleApiClient() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
mGoogleApiClient.connect();
mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
public View getInfoWindow(Marker arg0) {
View v = getLayoutInflater().inflate(R.layout.custom_infowindow, null);
TextView tv = (TextView) v.findViewById(R.id.infoText);
tv.setText("CO2 data: "+String.valueOf(co_mV) + "mV" +"\n" + "N2 data: "+String.valueOf(no2_mV) +" mV");
return v;
}
public View getInfoContents(Marker arg0) {
return null;
}
});
}