Skip to main content


Showing posts from August, 2011

ES6 101 - Map

ES6 101 - Map
ES6 Map is the topic of today’s post which also is the 11th in the ES6 101 Series. Map is going to be fairly easy, so before jumping into it, if you want to look at other features we have covered so far, here is a quick list for your reference.Fat Arrow FunctionsLexical Declarations - LetLexical Declarations - ConstSpread OPeratorTemplate LiteralRest OperatorDefault parametersDestructuringFor…ofSetNow let’s see what Map has to offer. As opposed to Set (which by the way, I highly recommend reading), Map saves values as key-value pair. Let’s see for ourselves how this works!Example of ES6 Mapvar dummyMap = newMap(); dummyMap.set("1"); // Method is set as against add in ES6 Setconsole.log(dummyMap); // [["1",null]] dummyMap.set("1", "one"); console.log(dummyMap); // [["1","one"]] dummyMap.set("2", "two").set("3","three"); console.log(dummyMap); // [["1","one&…

School mapping

For the first time in India, Manipur has introduced Geographic Information System (GIS) for mapping schools located in remote areas of the State.  The GIS was launched by the State with technical support from Delhi based Mission of Geo-Spatial Application which is an agency of the Central Government.

          Using the GIS, State Mission Authority of the Sarva Shiksha Abhiyan scheme has undertaken a mapping exercise of 4640 Primary and Upper Primary schools located in different parts of the State. In addition to mapping 4640 schools, the same exercise has identified 1093 different places where there is no school and in need of schools.

         Since the implementation of the Right to Education Act in India which lays down that schools should be located within a specific distance from human settlement areas, the need for using GIS for mapping schools located in far off places was felt all the more. The mapping of all the Government and aided Primary and Upper …

Speak to your Google map

Amazed? Shocked? by the title? Well don't be. This is true. You can now talk to your Google map. Without even touching your keyboard, you can now talk into your Google Maps to look for places and get directions. If you are using the Google Chrome browser in the U.S. simply click the microphone icon and speak into your computer.

            Using voice search can make it easier to find hard-to-spell places (like Poughkeepsie or Liechtenstein) or simply get directions without typing (for example, say “Directions from Los Angeles to San Francisco”).
            Hope, you enjoy talking to your Google Maps!

Get directions between different states in India

Having seen a simple hard coded directions example yesterday, today we will have a look at another simple example but not an hard coded one. In today's  example we will see the directions between different states in India. We have two simple list boxes stating Origin and Destination as lists of the states in India. You can select a state from either of the lists and then you will get the directions between the two selected cities.

    If you see yesterday's code and today's code you will find a lot of similarities and so  it would be easy to follow. The code will look lengthy, but it is just because of the list boxes code. So don't worry about the code, just go for it.

    The output of the above code will look as seen in the results section above. Hope you find this code helpful in understanding the directions services even further. Tomorrow, we will look at another - a bit complex example. Till then, happy mapping.
Note: The above code will not display any results …

'Sun & Moon' now on Google Maps

How we always wish to know the weather conditions at the picnic spot we have planned to visit during the weekends! This is now possible with the new Google Maps Weather Layer. Google has added a weather layer on Google Maps on August 18, 2011 that displays current temperatures and conditions across the globe.
         To add the weather layer, hover over to the widget in the upper right corner of Google Maps and select the weather layer from the list of options.

         When zoomed out, you will see a map with current weather conditions from for various locations, with icons to denote sun, clouds, rain and so on. You can also see the cloud coverage which can be switched on and off. The sun and moon icons also signify whether it is day or night in that part of the world.

         Clicking on the weather icon of a particular city will open up an info window with detailed data like current humidity and wind conditions, as well as the forecast for the ne…

Simple Directions

After taking an unintended long break after the 100th post, I am back with more examples and several more GIS news. Today, we will take a look at a simple example showcasing the use of the Google’s Directions Services. Using the Google’s Direction service, we can calculate the distance between two points, show the path between these two points, calculate the average time taken to traverse this distance and we can also enforce several constraints on this path.
    The Google Directions API is a service that calculates the directions between locations using an HTTP request. You may pass either an address (string) or a latitude/longitude coordinate as the origin and destination. If you pass an address as a string, the Directions service geocodes the string and converts it to a latitude-longitude coordinate to calculate directions. The origin and destination are two mandatory parameters for a directions request, whereas several other optional parameters like mode of tr…