Jump to content

Search the Community

Showing results for tags 'gmaps'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Waddup freaks? Thought I'd ask the more experienced people about Google places. I've been working on this very simple places search and I cannot get anything but a ZERO_RESULTS. It makes no sense to me at this point and I am offering up some code for debug if you'd be so kind. //BEGIN GOOGLE PLACES $( "#submit3" ).click(function(e) { e.preventDefault(); findPlaces(); $('#results').text("Triggah3!"); }); function findPlaces() { // prepare variables (filter) // var type = document.getElementById('gmap_type').value; // var radius = document.getElementById('gmap_radius').value; // var keyword = document.getElementById('gmap_keyword').value; var lat = document.getElementById("latitude").value; var lng = document.getElementById("longitude").value; // var lat = document.getElementById('lat').value; // var lng = document.getElementById('lng').value; var cur_location = new google.maps.LatLng(lat, lng); // prepare request to Places var request = { location: cur_location, radius: 50000, types: 'bank' }; // if (keyword) { // if used grab contents of search field // request.keyword = [keyword]; // } //console.log(request); // send request service = new google.maps.places.PlacesService(map); service.search(request, createMarkers); } // create markers (from 'findPlaces' function) function createMarkers(results, status) { // console.log(results); if (status == google.maps.places.PlacesServiceStatus.OK) { //ZERO_RESULTS // if we have found something - clear map (overlays) clearOverlays(); // and create new markers by search result for (var i = 0; i < results.length; i++) { createMarker(results[i]); } } else if (status == google.maps.places.PlacesServiceStatus.ZERO_RESULTS) { alert('Sorry, nothing is found'); } } // create single marker function function createMarker(obj) { // prepare new Marker object var mark = new google.maps.Marker({ position: obj.geometry.location, map: map, title: obj.name }); markers.push(mark); // prepare info window var infowindow = new google.maps.InfoWindow({ content: '<img src="' + obj.icon + '" /><font style="color:#000;">' + obj.name + '<br />Rating: ' + obj.rating + '<br />Vicinity: ' + obj.vicinity + '</font>' }); // add event handler to current marker google.maps.event.addListener(mark, 'click', function() { clearInfos(); infowindow.open(map,mark); }); infos.push(infowindow); } //END GOOGLE PLACES My script is loading just fine, in fact the map and some marker from my database load just fine upon their button click. Here is my link to the Google map API, key and library: <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3&sensor=true&libraries=places&key=AIva&&DCtOkeKl&&xHLrC7eYzoLXzPrbdkkkYU&&2"></script>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.