April 7, 2012

Is there an html "location" element?

Question by TestSubject528491

The HTML5 time element looks pretty cool, but I’m wondering if there’s such thing as a location or place element. It may be useful in GPS applications or the like?

Answer by Whymarrh

Sadly the <location> element doesn’t exist. I for one would agree that semantically it’d be great for web-apps that involve some sort of GPS, and can foresee the W3C adding it in the future (why not?).

But, if I understand correctly, HTML5 allows you create custom elements which may be a temporary fix for an up-and-coming web-app. Semantically I don’t think this is the greatest thing, all that extra markup to create an element, but some may use it. Eric Meyer has an article discussing custom elements.

Although, technically, I think that most browsers will render unknown markup given the proper CSS and/or JavaScript …

Answer by Starx

There is no such element called “location”.

You can show your GPS data in HTML using Google Maps API

   <div id="map" style="width: 400px; height: 300px"></div> 

   <script type="text/javascript"> 
      var myOptions = {
         zoom: 8,
         center: new google.maps.LatLng(51.49, -0.12),
         mapTypeId: google.maps.MapTypeId.ROADMAP
      };

      var map = new google.maps.Map(document.getElementById("map"), myOptions);
   </script> 

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!