Giter VIP home page Giter VIP logo

collective.geo.behaviour's Introduction

This package provides the ability to assign geographical information to Dexterity-based (plone.app.dexterity) content types within Plone and does so using collective.geo.geographer and collective.geo.mapwidget.

By applying the behaviour from this package to a Dexterity content type, a Coordinates field becomes available when creating or editing said content. This allows a user to either look-up coordinates for a place or feature via geo-coding, draw a geographical feature (such as a point, line or polygon) on a map, or enter details manually in Well-Known Text (WKT) format.

When stored, this geographical information can be used by the rest of the collective.geo set of packages. For instance, the coordinates can be displayed on maps against Collections or Folders using collective.geo.kml.

Found a bug? Please, use the issue tracker.

This addon can be installed has any other addons, please follow official documentation.

The behaviour adds a coordinates field to the content type and uses a collective.z3cform.mapwidget widget in order to allow the user to manipulate the geographic information.

The behaviour effectively acts as a proxy to load and save the data into the relevant location by querying for an collective.geo.geographer.interfaces.IGeoreferenced adapter and collective.geo.geographer.interfaces.IWriteGeoreferenced respectively for the given context.

This means that changes made upon as edits to the content object and changes made in the Coordinates tab are both modifying exactly the same data.

Once your type configuration has the behaviour applied, then content objects of said type will be marked as georeferenceable for collective.geo.geographer. This is achieved through the marker interface collective.geo.geographer.interfaces.IGeoreferenceable.

If you are configuring your Dexterity-based type through the web-based interface, then proceed to edit your content type in the Dexterity Content Types control panel. Under the Behaviours tab you will find the collective.geo Maps behaviour -- select this and save your content type.

Upon adding or editing an object of your content type, you will see the new field accordingly.

If you've created a file-system Dexterity type configuration, you need to specify the relevant interface as a behaviour:

collective.geo.behaviour.interfaces.ICoordinates

and import or re-import your type configuration. As an example, a type configuration at ${product_dir}/profiles/default/types/my.datatype.xml would look like this:

<?xml version="1.0"?>
<object name="my.datatype"
   meta_type="Dexterity FTI"
   i18n:domain="tdh.metadata" xmlns:i18n="http://xml.zope.org/namespaces/i18n">
    ...
    <property name="behaviors">
      <element value="collective.geo.behaviour.interfaces.ICoordinates" />
    </property>
    ...
</object>

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.