
Google Maps are changing the way we see the world. Lets change the way we look at Google Maps
Google Maps are a perfect match when you are dealing with location based apps. In this article we will learn to integrate the Google Maps api and Google Places api in our Ionic App and look at the solution to long press issue that Ionic suffers from and how to resolve that.
Get Ionic running:
Create a new Ionic Application:
Get list of all the platforms added in your application:
you will see the list of all the installed platforms
Add Android and iOS platforms to you app:
Following plugins will be installed once any platform is added:
ng-cordova is an AngularJs Service which integrates cordova plugins into IONIC Applications. Download ng-cordova.master.zip from here and place the ng-cordova.min.js in the www/js. ngCordova depends on AngularJS . In your index.html , place ng-cordova.min.js before cordova.js and after AngularJs/ Ionic files.
Inject ngCordova as an angular dependency in your angular module
Test the app on the browser
Lets add google places api in your index.html
index.html
app.js
style.css
Now run the app on the browser:
You will see it work as expected in the browser.
Now run the app on Android Device:
Issue with Selecting Auto Complete suggestions
All Set, you might assume. There is a problem though, you will have to long press the autocomplete option to actually get it selected. The issue is that Gmap dynamically adds elements that need the data-tap-disabled property, so you'll have to manually add the property after google has added these elements to the dom.
To get it working on the Android device you need to add the following function in your controller:
add disableTap() function in the input type
Now run the App on the Android Phone. Voila!
For live demo please visit this github link.




jQuery is often used on websites to enhance the user experience and to make the page interactive. Recently, I was trying to integrate gravitational equations to the DIV elements of the DOM and ended up the rabbit hole which resulted in this simple game Balloon Burst game. The game is simple! you click on balloons to increase your score from a heap of randomly moving balloons and bombs. High speed balloons gives more points and clicking a bomb will result in GAME OVER! Number of balloons increase with time and you can also configure things like speed etc before staring the game. I thought, why not write about my experience -- below is a rundown of creating the game.
I started with setting up the initial DOM structure and give some styling to it. In the document.ready() function initialize the global variables for configuring the movement.
To get a random number we will simply use Math.random() function which is predefined in jQuery and to have a random number between a range of values, we will play with this function a little bit
This function will return a random integer between min and max values. Another simple function using Math.random() which will return a random direction string
createItem() function to create a random number based on the probability variable
Considering only 4 directions for now. createItems() function will create a random item (balloon or a bomb according to the probability given by the user). The reason of storing the speed of the div in the markup is to calculate the score when the balloon bursts( click event). Since the newly created element will be a jQuery object, so creating a jQuery object variable using '$'. That means every time createItem() will get called, a new DIV element will be appended to the body with a random position through css. Note here, balloons need to have position absolute to get rendered at the random positions on the screen. Don't worry about the global variables values that will be fetched from the user from the initial screen. Fetching and setting variables for the functions through input screen-
So far so good ! Items creation function has been created, the DOM has been created and variables has been fetched. Now the main challenge comes ! How to update the positions of all the objects simultaneously and dynamically and have a rebound effect when balloon touches the screen boundaries. JQuery doesn't support classes and OOPS so we cannot create objects instances of class. Then ? In jQuery we can declare a function (here updatePosition() ) once and call it with different parameters thereby creating a new unique instance for each function call. That mean for every newly created item updatePosition() function will have a different instance with different parameters. The function should take three parameters viz. the newly created object as a parameter (to update its css), a random direction and random speed.
We have to update the position in specific time intervals so this fact is clear that position should be updated using setTimeInterval() function. The speed logic can be induced to the div elements using two methods.
Both approach are right but in first approach the maximum speed is limited from coding end as the max speed according to it will be when the time interval will be 1ms, whereas in second approach the magnitude of positioning factor can exceed to any positive number. So we will use second approach here.
According to the second approach -
The function will update the position of the passed jQuery object through 'init_left' and 'init_top' variables in every 1ms. This will generate the animation effect and on having these values greater than the boundary values the directions are changed. This logic will update left and top both position simultaneously.
Not that hard! Right? You can add new implementations to this project by cloning or forking the code base from https://github.com/swastikpareek/jq_ballon_game or you can create your own jQuery effects or create your own custom game. In this way you will get to learn about new features and new functions in jQuery.

Its almost paradoxical that the internet, that helped in making the world a smaller place has local as its next major focus area, but there has been a spate of activity in the local internet space in the last year which seems to suggest so. While this space has seen a lot of new services coming up, even the established players are trying to a get a piece of the local pie.
One of the most talked about startup of last year was foursquare. It is a hybrid between a social game and a city guide. You discover interesting places in your city and share it with your friends. It adds the gaming aspect by awarding you points and badges for going to your favorite hangout spots. It already has the early adopters hooked and bloggers like robert scoble, techcrunch and mashablevouching for it. Initially it was limited to some cities but very recently they removedthis restriction. Although they do not have a business model as of yet,they already are encouraging interesting discussions about how they can monetize their service. Very similar in the mode of foursquare are other apps like gowalla andmytown.
Even some of the established players are venturing into this space. Twitter announced last november that tweets can now be geo-tagged, which will allow people to know where you tweeted from. Google launched their Google Latitudeservice which allows you to share with your friends where you are. There is also another interesting service called Glympse which is competing with Goggle Latitude in this space. Also the portals like msn, yahoo and aol also have turned their attentions towards getting a bigger share of the local advertising share.
Turning our attentions closer to India, while they may not be apps or truly internet based services, I personally think JustDial is doing a very good job of solving the problem of a local business listing in India. They have very cleverly used the intersection of phone,sms and internet to make giant strides and are an indispensable service for me.
What i would love to have though is a service which gives me a good listing of the events happening around me. Do you have an idea for a location based service that you would like to bring to life ? Tell us about it.

This is a follow-up blog post from Our Jounrey with MEAN. For those who are not familiar with MEAN, you must go through the previous blog post before proceeding here.
Contrary to Mean core, which is hosted on github, mean packages are hosted on gitlab at https://git.mean.io that fits in the larger vision of MEAN packages. To contribute a packge, an account on gitlab is required. This can be done right from the MEAN cli

This is very similar to your usual scaffolding command and generates a skeleton structure for your mean package.
Next step for you would be to go ahead and write code in the respective files. Review the code and unit test it thoroughly. Now comes the stage wherein you push the code to the mean repo. All you need to do to publish the mean package is:
To see your module, goto https://git.mean.io/u/<username> and you can see your package listed there. Couple of things you should take care of while contributing a package:
1> Make sure you write an extensive README file.
2> Create an example page to demo the functionality that the package provides.
3> Write clean code.
4> Collaborate rather than compete.