Skip to content

alexroutledge/current-location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<current-location>

Web Component wrapper for geolocation based data using Polymer.

Maintained by Alex Routledge.

Demo

Check it live.

Usage

  1. Import Web Components' polyfill:

    <script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.0.20130711/polymer.min.js"></script>
  2. Import Custom Element:

    <link rel="import" href="src/current-location.html">
    <link rel="import" href="src/geolocation-wrapper.html">
    <link rel="import" href="src/google-maps.html">
  3. Start using it!

    <polymer-element name="geolocation-wrapper" extends="current-location">
     <template>
       <current-location position="{{position}}"></current-location>
       <template if="{{position}}">
       	 <content></content>
         <google-maps zoom="12" type="hybrid" latitude="{{position.coords.latitude}}" longitude="{{position.coords.longitude}}"></google-maps>
       </template>
     </template>
     <script>
       Polymer('geolocation-wrapper', {
         applyAuthorStyles: true
       });
     </script>
    </polymer-element>
    <geolocation-wrapper>
      <p>This is a map of your current location</p>
    </geolocation-wrapper>

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

License

MIT License

About

Web Component wrapper for geolocation based data using Polymer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages