Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to filter Google map
    text
    copied!<p>I m working with google map and i would like to hide if it's possible the restaurant and hotel from my map. So my question is how to eliminate or apply a filter to hide restaurant and hotels points in google map api.</p> <p>Thank you for all. edit.</p> <pre><code>&lt;script&gt; function writeAddressName(latLng) { var geocoder = new google.maps.Geocoder(); geocoder.geocode({ "location": latLng }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) document.getElementById("address").innerHTML = results[0].formatted_address; else document.getElementById("error").innerHTML += "Unable to retrieve your address" + "&lt;br /&gt;"; }); } function geolocationSuccess(position) { var userLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); writeAddressName(userLatLng); $(document).ready(function(){ var styles = [ { stylers: [ { hue: "#00ffe6" }, { saturation: -20 } ] },{ featureType: "road", elementType: "geometry", stylers: [ { lightness: 100 }, { visibility: "simplified" } ] },{ featureType: "road", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; var styledMap = new google.maps.StyledMapType(styles, {name: "Styled Map"}); // display map var mapOptions = { zoom: 11, center: userLatLng , mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP,'map_style'] } }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); map.mapTypes.set('map_style', styledMap); map.setMapTypeId('map_style', styledMap); }); // marker new google.maps.Marker({ map: map_style, position: userLatLng }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload