react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

How do I remove point of interest from the map component?

Open joshualimpj opened this issue 5 years ago • 3 comments

Is it possible to remove all point of interest from the map?

joshualimpj avatar Jul 04 '18 17:07 joshualimpj

Yea, I had the same issue, i did this: (The options -> styles part) <GoogleMap ref={(map) => map && map.fitBounds(bounds)} defaultZoom={defaultZoom} defaultCenter={new google.maps.LatLng( props.mapCenter.lat, props.mapCenter.lng, )} options={{ styles: [{ elementType: "labels", featureType: "poi.business", stylers: [{ visibility: "off", }], }], }} ><Markers etc /></GoogleMap>

gaelicgod avatar Jul 16 '18 16:07 gaelicgod

Hmm, for some reason this doesn't work for me. I tried various options:

    {
      featureType: 'poi',
      stylers: [{ visibility: 'off' }],
    },
    {
      featureType: 'poi.business',
      stylers: [{ visibility: 'off' }],
    },    {
      featureType: 'poi',
      elementType: 'labels',
      stylers: [{ visibility: 'off' }],
    },
    {
      featureType: 'poi.business',
      elementType: 'labels',
      stylers: [{ visibility: 'off' }],
    },

but none seems to work.

wojtekmaj avatar May 30 '21 16:05 wojtekmaj

@gaelicgod Thanks a lot.

AbdullahAnsarii avatar Dec 03 '21 12:12 AbdullahAnsarii