0

with JxMaps I can show a Google-Map window within Java Swing.

When zooming in, Google shows much details as Restaurants and Shops. I also can click on those Restaurants and Shops - but that's something I don't want to have in my application.

Anyone having an idea on how to disable it?

I think it might be possible when setting map options:

            // Getting the associated map object
            map = getMap();
            // Creating a map options object
            MapOptions mapOptions = new MapOptions();
            // Creating a map type control options object
            MapTypeControlOptions controlOptions = new MapTypeControlOptions();
            // Changing position of the map type control
            controlOptions.setPosition(ControlPosition.TOP_RIGHT);
            // Setting map type control options
            mapOptions.setMapTypeControlOptions(controlOptions);
            // Setting map options
            map.setOptions(mapOptions);

But I cant find an appropriate option.

Thank you very much

4

1 回答 1

2

MapOptions 没有允许隐藏 POI 的属性。但是您可以使用隐藏的默认 POI 创建自定义地图样式。请看下面的例子:

MapTypeStyler styler = new MapTypeStyler();
styler.setVisibility("off");

MapTypeStyle style = new MapTypeStyle();
style.setElementType(MapTypeStyleElementType.ALL);
style.setFeatureType(MapTypeStyleFeatureType.POI);
style.setStylers(new MapTypeStyler[]{styler});

StyledMapType styledMap = new StyledMapType(map, new MapTypeStyle[]{style});
map.mapTypes().set("newStyle", styledMap);
map.setMapTypeId(new MapTypeId("newStyle"));
于 2017-01-23T10:16:26.910 回答