Skip to main content

Get Script

  $.getScript('https://maps.googleapis.com/maps/api/js?libraries=places&key=AIzaSyCIeyrzeVetCiVKGvqLtNl4ocP5zX_E1jo', function(){
     $.getScript('https://cdnjs.cloudflare.com/ajax/libs/geocomplete/1.7.0/jquery.geocomplete.min.js', function(){
       $("#event_auto_pickerlocation").geocomplete().bind("geocode:result", function (event, result) {
         // JSONArray Results = jsonObj.getJSONArray("results");
         $("#clear_location_filter").removeClass("make_it_hidden");
           var data = JSON.stringify(result);
           var data = JSON.parse(data);
          // JSONObject zero = data.getJSONObject(0);
           console.log(data.address_components);
           var address_components = data.address_components;
          var city = "";
          var state ="";
          var country ="";

           for(var i=0, len=address_components.length; i<len; i++) {
            var ac = result.address_components[i];
           if(ac.types.indexOf("locality") >= 0) city = ac.long_name;
          if(ac.types.indexOf("administrative_area_level_1") >= 0) state = ac.long_name;
          if(ac.types.indexOf("country") >= 0) country = ac.long_name;
          }

          Session.set("filter_active","true");
          Session.set("selected_city",city);
          Session.set("state",state);
          Session.set("country",country);
});
    });

Comments

Popular posts from this blog

Meteor JS REST API

WRITE A POST Shahid Shaikh FOLLOW Engineer, Blogger from Mumbai. RESTful CRUD Operations in Meteor.js Published Dec 31, 2015 Last updated Jan 19, 2017 Introduction Meteor is a popular framework for building real-time web applications. We have already covered a tutorial which explains  how to build chat system using Meteor.js . In this tutorial, we will learn how to develop a RESTful API using Meteor which perform CRUD operations. Creating new project Create a new meteor project using the following command: meteor create appName Choose an application name of your choice. Once Meteor is done creating the project, you will see the directories and files created by Meteor in the folder name. We will not need them as of now, so we will delete all of those files and create whatever we need in the coming section. Installing iron-router In order to perform routing in Meteor, we will use  this awesome...

Unable to detect adb version, adb output: /home/bird/Android/Sdk/platform-tools/adb: 1: /home/bird/Android/Sdk/platform-tools/adb: Syntax error: Unterminated quoted string

29 down vote Ubuntu 14.04.3 LTS Got same error after update Android Studio and then Android SDK. [SOLUTION : Downgrade /platform-tools folder] Download this arch. :  https://dl-ssl.google.com/android/repository/platform-tools_r23.0.1-linux.zip Go to your Android SDK folder Remove old /platform-tools Insert downloaded from link above