Git Product home page Git Product logo

collective.geo.leaflet's Introduction

This package use the collective.geo.* suite with leaflet.

[ ] Get "attribution" map from registry

[ ] Testing loading map with Robot

[x] Add uninstall profile

[x] Translations

[ ] Simple element view should use geojson

[ ] Use leaflet for control panel map

[ ] Use leaflet for configure map

  • collective.geo.behaviour
  • collective.geo.contentlocations
  • collective.geo.geographer
  • collective.geo.json
  • collective.geo.mapwidget
  • collective.geo.openlayers
  • collective.geo.settings
  • collective.js.leaflet
  • collective.z3cform.mapwidget
  • collective.z3cform.colorpicker

What is a leaflet baseLayer : http://leafletjs.com/examples/layers-control.html

In Plone, if you want to add a baseLayer, you have to add a subscriber on collective.geo.geographer.interfaces.IGeoreferenced (for exemple, in configure.zcml):

<subscriber
    for="collective.geo.geographer.interfaces.IGeoreferenced"
    provides="collective.geo.leaflet.interfaces.IMapLayer"
    factory=".maplayers.OpenStreetMap
    />

After, create your factory in python (maplayers.py):

from collective.geo.leaflet.maplayers import MapLayer
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile


class OpenStreetMap(MapLayer):
    name = u"osm"
    title = _(u"Open Street Map")
    index = ViewPageTemplateFile('browser/layers/osm.pt')

And add your javascript into a template file osm.pt:

<script type="text/javascript">
    var osmAttrib = '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors';
    var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png';
    var %(name)s = L.tileLayer(osmUrl, {
         attribution: osmAttrib,
    });
</script>

This package is tested using Travis CI. The current status is :

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.