Hello I try to change the default color that have (white) to black, this in the google maps api v2, anyone know how I can do this?
PD: is the margin of infowindow
this is my code where I change the content of infowindow but need change the margin :S
GoogleMap map = ....
map.setInfoWindowAdapter(new InfoWindowAdapter() {
@Override
public View getInfoContents(Marker marker) {
View v = getLayoutInflater().inflate(
R.layout.info_window_layout, null);
v.setBackgroundColor(Color.BLACK);
return v;
}
});
thanks for reply
Add different color markerspng at the end of the URL to get a blue marker. To add a green marker simply change it to green-dot. png so that the URL will be http://maps.google.com/mapfiles/ms/icons/green-dot.png .
To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of the marker and its style. Go for the color or style you want to change and then click OK to see the effect. Click on the button labeled Done to save your new marker color settings.
maps. InfoWindow({ content: some_text, maxWidth: 200 }); The documentation notes that the "value is only considered if it is set before a call to open. To change the maximum width when changing content, call close, setOptions, and then open."
In InfoWindowAdapter change to
@Override
public View getInfoWindow(Marker marker) {
View view = ((Activity)context).getLayoutInflater()
.inflate(R.layout.map_custom_infowindow, null);
return view;
}
@Override
public View getInfoContents(Marker marker) {
return null;
}
Use getInfoWindow instead of getInfoContents to provide full info window. Make sure to set appropriate backgrounds for root view, e.g. something with a triangle at the bottom center.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With