Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch for Hospitals and Clinics near a particular zip code
    primarykey
    data
    text
    <p>I would like to know a method to search for hospitals or clinics within a particular radius around a pin code. How do I go about this and integrate it into my website? I would be using google maps api for the first time so please try and use simple terms. </p> <p>Okay so I manage to do this much</p> <pre><code>&lt;script type="text/javascript"&gt; var map; var infowindow; var geocoder; var lat; var lng; var custom; function initialize() { geocoder = new google.maps.Geocoder(); var address = "Mumbai 400004"; geocoder.geocode({ 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { lat = results[0].geometry.location.lat(); lng = results[0].geometry.location.lng(); custom = new google.maps.LatLng(lat, lng); map.setCenter(custom); } }); var mapOptions = { zoom: 12, center: custom, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var request = { location: custom, radius: 500, types: ['hospital'] }; infowindow = new google.maps.InfoWindow(); var service = new google.maps.places.PlacesService(map); service.nearbySearch(request, callback); } function callback(results, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { for (var i = 0; i &lt; results.length; i++) { createMarker(results[i]); } } } function createMarker(place) { var placeLoc = place.geometry.location; var marker = new google.maps.Marker({ map: map, position: place.geometry.location }); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(place.name); infowindow.open(map, this); }); } &lt;/script&gt; </code></pre> <p>the problem now is that markers for hospitals are not showing on the map. What mistake have I made here ? Thank you for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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