There is a "person" icon which allows user to view "Street View". I don't want this functionality on my map, is there a way to remove it or disable it? And I am not using JavaScript I am doing it using GWT.
Google-Maps v3 am using.
private void initMap() {
mapVp.setSize(String.valueOf(BodyPanel.bodyWidth - 505),
String.valueOf(BodyPanel.bodyHeight + 5));
LatLng myLatLng = LatLng.create(24.440099, 46.843498);
final MapOptions myOptions = MapOptions.create();
myOptions.setZoom(5);
myOptions.setCenter(myLatLng);
setStreetViewControl(myOptions.getJso(), false); //Added now
myOptions.setMapTypeId(MapTypeId.ROADMAP);
myOptions.setMapTypeControl(true);
Timer load = new Timer() {
@Override
public void run() {
map = GoogleMap.create(mapVp.getElement(), myOptions);
hPanel.add(LoginDashboardModule
.mapLegends(map, "Live Tracking"));
}
};
load.schedule(1000);
}
This is my code I am getting error after adding this line setStreetViewControl(myOptions.getJso(), false);
I just used the line below and got the output.
myOptions.setStreetViewControl(false);
You can do this with JSNI.
public static MapWidget createMapWidget(double lat, double lng,
final String width, final String height, int zoomLevel) {
// Set the options of the map widget.
MapOptions options = new MapOptions();
options.setZoom(zoomLevel);
options.setMapTypeId(new MapTypeId().getRoadmap());
setStreetViewControl(options.getJso(), false);
options.setCenter(new LatLng(lat, lng));
/* The map widget */
final MapWidget mapWidget = new MapWidget(options);
mapWidget.setWidth(width);
mapWidget.setHeight(height);
return mapWidget;
}
public static native void setStreetViewControl(JavaScriptObject obj,
boolean control) /*-{
if (obj)
obj.streetViewControl = control;
}-*/;
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