Vote count:
0
I'm creating a map from an address using the Google Maps API by geocoding the address and getting the lat and long and then giving that to the Places API and creating a map.
However, the map that is being rendered has grey vertical bars running through it.
Here is a screenshot:
Any idea why this is happening?
Here is my code ( I apologise in advance for the horrible formatting. I tried pasting it, hand typing it. Nothing I tried made it look any better):
$.ajax({
url: 'http://ift.tt/1vy4Vat',
dataType: 'json',
jsonp: 'callback',
method: 'GET',
success: function(results){
console.log(results);
queryLat = results['results'][0]['geometry']['location']['lat'];
queryLong = results['results'][0]['geometry']['location']['lng'];
function callback(mapsResults, status){
if(status == google.maps.places.PlacesServiceStatus.OK){
for(var i=0; i<mapsResults.length; i++){
var place = mapsResults[i];
createMarker(mapsResults[i]);
}
}
}
var map;
var service;
map = new google.maps.Map(document.querySelector('body'), {
center:new google.maps.LatLng(queryLat, queryLong),
zoom:15
});
var request = {
location: new google.maps.LatLng(queryLat, queryLong),
radius:'500',
query:'mechanic'
};
service = new google.maps.places.PlacesService(map);
service.textSearch(request, callback);
}
});
asked 1 min ago
Map created with Google Maps API ( Places API and Geocode ) showing map with vertical bars
Aucun commentaire:
Enregistrer un commentaire