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...
curl http://localhost:8042/studies/333b2c11-52e9feea-5516186e-ecd61f37-69da2603  curl http://localhost:8042/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94 bird@bird-Lenovo-ideapad-310-15IKB:/media/bird/2AE477A5E4777245/Meteor/OrthancMirror/build$ curl http://localhost:8042/patients [    "333b2c11-52e9feea-5516186e-ecd61f37-69da2603",    "da39a3ee-5e6b4b0d-3255bfef-95601890-afd80709" ] bird@bird-Lenovo-ideapad-310-15IKB:/media/bird/2AE477A5E4777245/Meteor/OrthancMirror/build$ curl http://localhost:8042/studies [    "9b5629ef-c28c48db-b3593009-35fda9cb-7a0bb799",    "abae0b24-5a718d9e-1b560140-2cda3ae0-30b846cb" ] bird@bird-Lenovo-ideapad-310-15IKB:/media/bird/2AE477A5E4777245/Meteor/OrthancMirror/build$  curl http://localhost:8042/series [    "993a521c-1b11574c-92e1c71d-a048784c-36866be0",    "5f19601c-3e5fa872-e566e9f2-36aa3b31-dc719c3e" ] bird@bird-Lenovo-ideapad-310-15IKB:/med...