Skip to main content

Posts

Showing posts from April, 2012

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&…

50000 hits and live examples

Hello to all the blog readers - to the regulars and the first timers. Spatial Unlimited just crossed the 50,000 all time hits milestone and so its time to celebrate and also mark the occasion with something new and interesting.


    The new addition to this blog is that, you will now be able to enjoy the codes live on the blog. I am adding some life to the blog by converting all the earlier life-less codes to JsFiddle powered live examples. I have converted a few and am sharing the links here. Please share your feedback and let me know what you think of the new additions. Hope you keep enjoying the blog as much as I enjoy updating it! Cheers!

Links to Live Examples:
1. Simple Google Map
2. Simple Map Marker
3. Multiple Markers
4. KML Layer

Titanic mapping - 100th aniversary

When you hear "Titanic", the first thing that comes to your mind is the 1997 classic, Kate Winslet and Leonardo DiCaprio starer, James Cameron directed epic romantic disaster film "Titanic" which after more than 15 years is re-released in 3D. You must be wondering why I am talking about the movie here on this blog. Well, its not about the movie, but about the mapping of the Titanic that interests me!

    April 15, 2012 will mark the 100th anniversary of the sinking of the Titanic in the North Atlantic Ocean. A century ago the Titanic collided with an iceberg in the north Atlantic and sank. Mapping traveler's hometowns, revels the immigrant status of most people traveling third-class, who also suffered the highest fatality rate. ESRI, has created a map story that will help us look at the geography, class and the fate of the passengers aboard the ship 100 years ago. The online map displays the hometowns of all the passengers aboard the Titanic excluding the …

A Giant called Google...

Wondering what you will be reading in this post today and what is "Google Giant"! Well, I was working on a simple project a couple of months back and that is the time when I was amazed and by the size of data that Google Maps servers might be having! As most of the readers (developers and enthusiast included) would know or might have noticed, Google maps are rendered by stitching small images together. You must have observed this on quite a number of occasions, when you see grey tiles when you have a slow internet connection in particular. It takes time for the images or tiles as we call them to be displayed.

    Let us try and estimate what could be the size of the Google Maps data! Before proceeding, let's make a few assumptions and considerations.
1. Let's consider the Google Street View maps only.
2. The zoom level that is considered for the calculations is 21 - the max zoom level allowed on Google Maps API.
3. All the numbers are just an estimate and not ac…

Google Weather Layer - Simple Example

As promised in the last post, we will be having a look at a very simple example that will help us understand how we can use the weather layer effectively in our Google Map applications using the Google Maps API v3. The weather layer is basically a combination of 2 layers - the Weather Layer and the Clouds Layer. The weather layers displays the weather icons and the temperature corresponding that icon whereas the clouds layers displays the cloud cover across the globe. We can choose to display or hide any of these layers. Let us now dive into a very simple code that will help us understand the basics of the Weather Layer library today.



    The output of the above code will appear as seen in the result section above. You will find a map centered at "India" with both the weather and cloud layers enabled!

    Most part of the above code is similar to most other examples you will find on this site. There are just 2 new and importan…

Weather Layer now available with Google Maps API

Yes! We now have the Google's Weather Layer available to use with the Google Maps API v3. The weather layer was released on Google Maps website in August 2011with cloud imagery from the U.S. Naval Research Lab and weather forecast information from weather.com. Since then developers across the globe have been waiting for this layer to be released for use with the Maps API. You can find about the weather layer on the Google Maps in the post I wrote in August last year.

    This weather layer has now been made available for use with the maps API through the weather library which basically consists of two classes: 'WeatherLayer' and 'CloudLayer'. The 'WeatherLayer' class displays the current weather conditions at various locations, as well as a forecast for the next four days when a user clicks on the icon at that particular location. The units for temperature (degrees Celsius and Fahrenheit) and wind speed (km/hr, miles/hr, m/sec) can also be configured …

Google's latest April Fool's Prank

Google has done it again! Just in time for the April Fool's Day, Google introduced Google Maps Quest, a retro 8-bit version of its mapping tool... which is completely awesome! In the video available below, Google employees introduce the new version for the Nintendo Entertainment System (NES), replete with finicky cartridge and the vintage 8-bit music.



      With this new Google Maps Quest, one can do all the things that can already be done on the regular Google Map. You can search for famous landmarks and sites around the world like the Taj Mahal, Agra, India.


      You can also get detailed directions to avoid dangerous paths, and battle your way through a world of powerful monsters and mystic treasures. You can see the sequence of following images at lat-long 0,0 at incremental zoom levels starting from zoom level 9.







       To use this awesome 8-bit (from your computer of course), head over to Google Maps and simply click on the Quest box in the top right corner. You woul…