Mapping improvements

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Mac_Weber's picture

I'm opening this discussion for brainstorming Mapping improvements.

I think many of the ideas discussed here may be worked later on sprints. @dasjo also came with the idea of doing a sprint during DrupalCon, which would be VERY interesting!

My plan is to use GeoJSON as the main layer type on Mapping, whenever it's possible. This approach will allow better integration with Views and later using BBOX strategy.

I've done some successful tests with GeoJSON on Mapping Leaflet sandbox.

I have some new ideas for Views integration. By "new" I mean some ideas that are not currently being used in other mapping modules. Some of them are:

Allow any View based on fields to output GeoJSON as a JS

Benefits

  • In a view that displays, for example HTML table, the view would still display HTML table and also output a JS snippet that would add the same data to a map using GeoJSON.
  • Allow any view based on fields to be listed/used as data layers. By "listed" I mean in the user interface. It would be a problem having many views, then I think the best way is to allow admin to select which views are supposed to be listed as a layer.

Allow node text fields to be rendered as a map

Like GitHub, it would be very easy to input GeoJSON text and render it as map. This can be done in 2 ways:

  • Text input format - a new GeoJSON format which would be configured to be displayed as a chosen map.
  • Map widget for text fields - the same idea, but can have individual configuration for each field.

Field widgets for geofield

Add a mapping widget that can be configured to display a chosen map with the location.

Benefits

  • Many modules have such integration. Having this code in Mapping would get rid of this code spread among many different map library modules.
  • Admin will be able to choose any of the maps from different libraries installed.
  • It will help listing many nodes on Views with its own mini maps.

Other improvements

User Interface

I started coding for the user interface just to check if some API changes would not break its functionality. It is working as a proof of concept, but it needs a lot of coding yet. This branch is not public, as I've been rebasing it on 7.x branch many times. If anyone feels that have time/interest on coding for it I'd happy hand this code I've done.

Comments

i'm adding my comments from

dasjo's picture

i'm adding my comments from the mail conversation that we had:

Views geojson needs a rewrite. It's too complex for its simple task and not very flexible to integrate with.

But going that route sounds promising to me. Have you see my integration leaflet geojson? Maybe there are some ideas.

Ideally the views integration that outputs geo data in a standard way (as geojson) would be available for use with leaflet openlayers etc / could emerge to be standard amongst the mapping libs.

Make each part as small and reusable as possible. Try to leverage existing php libraries maybe using composer, psr 0 etc and try to decouple Drupal specific integration logic from generally reusable parts. And make things future compatible with d8 coding styles

geophp library

Mac_Weber's picture

Don't you think geophp library is an overkill just for getting WKT transformed to geometry?

I'm thinking about writing a code for it, but I'm not totally sold to either ideas.

BTW, geophp library is not needed to get data from geofield, as it can be rendered as WKT from geofield's code. I'm doing it to use views_geojson without any patch to work with the new geofield module.

yep, never said that you need

dasjo's picture

yep, never said that you need geophp :)

Make each part as small and

Brandonian's picture

Make each part as small and reusable as possible. Try to leverage existing php libraries maybe using composer, psr 0 etc and try to decouple Drupal specific integration logic from generally reusable parts. And make things future compatible with d8 coding styles

This times a million. I'm actually planning on giving a talk at Badcamp talking about this very thing.

http://2013.badcamp.net/sessions/exploring-drupal-8-laying-out-vision-ge...

great to hear brandonian! if

dasjo's picture

great to hear brandonian!

if you could expand on your ideas maybe that would help d8 mapping sprint efforts at drupalcon prague?

Really interesting

Mac_Weber's picture

I plan to start porting as soon as both D8 and Mapping get a bit more mature.

D8 plugins system is very similar to Ctools plugins, which makes a port a very interesting task.

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week