Giter Club home page Giter Club logo

leaflet-map-component's Introduction

leaflet-map-component

Make leaflet maps using declarative Polymer web components. To get started read the documentation or checkout the demo.

Quickstart Guide

Install this web component using Bower:

bower install leaflet-map-component

Import the main component and start creating your map:

  <head>
    <script src="../platform/platform.js"></script>
    <link rel="import" href="leaflet-map-component.html">
    <style>
      html, body {
        margin: 0;
        height: 100%;
      }
      leaflet-map {
        height: 100%;
      }
    </style>
  </head>
  <body unresolved>
    <leaflet-map longitude="77.2" latitude="28.4" zoom="12">
      <leaflet-marker longitude="77.2" latitude="28.4">
        Marker I
      </leaflet-marker>
      <leaflet-circle longitude="77.2" latitude="28.4" radius="300">
        Round
      </leaflet-circle>
    </leaflet-map>
  </body>

Contribute

Want to contribute? Resolve an issue and send a pull request.

Read the quick guide on how to start contributing.

##License

MIT license - http://www.opensource.org/licenses/mit-license.php

leaflet-map-component's People

Contributors

olanod avatar prtksxna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

leaflet-map-component's Issues

Not working on Polymer 2

Unfortunately the map is not showing when i am using leaflet on Polymer 2.
Should it work or are you just not supporting it?

Write tests

Is there a specific way to test web/polymer components?

let anything be a marker

Can we use any element as a marker, no just leaflet-marker? I have a custom element which shadows some HTML/SVG markup and events and I'd like it to be directly my marker.

<leaflet-map>
    <my-marker marker></my-marker>
</leaflet-map>

Bower: Flat dependency

Currently all the paths are like bower_components/pol… whereas they need to be ../pol…

Can't extend this component and use it with leaflet.draw plugin

I've tried to extend this component and use it with leaflet draw plugin.

<template>

    <shadow></shadow>
</template>

<script>
    Polymer('my-map', {

        attached: function() {
            this.super();

            var drawItems = new L.featureGroup();
            this.map.addLayer(drawItems);

            var drawControl = new L.Control.Draw( {
                edit: {
                    featureGroup: drawItems
                }
            });
            this.map.addControl(drawControl);
        }
    })
</script>

But somehow draw and edit toolbars lacks icons ans so on. It should be related to some css issues.

<script src="/static/bower_components/leaflet.draw/dist/leaflet.draw.js"> </script>

Zoom controls visible when they shouldn't

Hi
When I e.g. have a drawer panel that appears from the left, the zoom controls remain visible on top. The same thing goes if I have a paper-action-dialog poppint up that overlays the map. For some reason this only happen on a deployed web site and not when running the site on my own machine. Any ideas?
Best Regards
Justin Case
P.S. Thumbs up on the 0.8 upgrade from here :-)

Stop triggering watcher

When the user zooms the map we change the attribute zoom on the element on zoomend. This calls the zoomChanged function. Calling this function is redundant, should it still be done? If not, how?

On tables/Mobiles doesn't work

Hi there,

There is some problems with events on tables and mobiles (touchable devices). Zoom in/out doesn't work and neither markers/polygons. I have same related problem in other projects, whether I resolve the problem I would contact with you.

Good luck

leaflet-marker not loading because L.icon is not set

Exception caught during observer callback: Error: Couldn't autodetect L.Icon.Default.imagePath, set it manually.
    at o.Icon.Default.o.Icon.extend._getIconUrl (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:7:13531)
    at o.Icon.o.Class.extend._createIcon (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:7:12461)
    at o.Icon.o.Class.extend.createIcon (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:7:12339)
    at o.Marker.o.Class.extend._initIcon (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:7:15248)
    at o.Marker.o.Class.extend.onAdd (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:7:14204)
    at o.Map.o.Class.extend._layerAdd (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:6:29891)
    at o.Map.o.Class.extend.addLayer (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:6:21393)
    at o.Marker.o.Class.extend.addTo (http://prtksxna.github.io/leaflet-map-component/components/leaflet/dist/leaflet.js:7:14371)
    at leaflet-marker.Polymer.mapReady (http://prtksxna.github.io/leaflet-map-component/components/leaflet-map-component/leaflet-marker-component.html:98:23)
    at leaflet-marker.Polymer.mapChanged (http://prtksxna.github.io/leaflet-map-component/components/leaflet-map-component/leaflet-marker-component.html:89:13)

abbreviation for latitude and longitude

With today's frameworks everything is more declarative and elements tend to have a lot of attributes, it helps a bit if those attributes are shorter. E.g. <leaflet-map lat='0' lng='0'></leaflet-map>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.