Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide the Streetview street name labels on the street floor

I need to get the street names (shortDescription) on street floor removed from streetview panorama: Label I want removed

I know this is possible as seen on https://geoguessr.com/world/play

They seem to use the same kind of json syntax as for customizing a google maps layout f=[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}], l={disableDefaultUI:!0,disableDoubleClickZoom:!0,clickToGo:!0,linksControl:!0,styles:f} But I'm not even sure these labels are actualy part of the POI ...

I really need some help Thanks !

like image 455
Adrien Avatar asked Feb 07 '23 05:02

Adrien


2 Answers

Try to use the showRoadLabels option on StreetViewPanoramaOptions. Works fine for me.

  var panorama = map.getStreetView();
  panorama.setOptions({
     showRoadLabels: false
  });

Docs: https://developers.google.com/maps/documentation/javascript/3.exp/reference#StreetViewPanoramaOptions

like image 107
Matheus Maximo Avatar answered Mar 08 '23 23:03

Matheus Maximo


I just had this same problem, and I figured out the problem was the version of the Google Maps API. Geoguessr uses an older version of the streetview panorama API. Notice the difference:

Version 3.24 (no street names): https://jsfiddle.net/922urh2j/

<script async defer src="https://maps.googleapis.com/maps/api/js?v=3.24&key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initialize"></script>

Latest version (includes street names): https://jsfiddle.net/922urh2j/1/

<script async defer src="https://maps.googleapis.com/maps/api/js?&key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initialize"></script>

So far as I can tell, there's no option to disable street names if you're using the latest version of the API.

like image 30
Giddeon Garber Avatar answered Mar 08 '23 23:03

Giddeon Garber