Great work guys! It's really exciting to see how much progress you have been making over the last month or so.

I'd like to use this on some upcoming projects but a few of them don't require the full awesomeness of the Geo module. This patch expands the data storage options available when building OpenLayers views. Basically it:

* preserves existing support for Geo and Location
* adds support for choosing lat/lon fields for points (a la NiceMap)
* begins the work of implementing support for generic WKT (not yet fully implemented)

Happy to make any changes here if you need. If this patch, or something similar, would be acceptable, I'd like to spend some more time cleaning up openlayers_views as well as take a look at some of the @TODO's in the code regarding missing theme functions. Let me know what you think.

Cheers,
Robert

Comments

phayes’s picture

This looks great - it's totally in line with where we would like to be going with our views integration. Would you like me to commit this patch now or is there more you would like to do on it first?

We would love all the help we can get, and are more than willing to commit patches - especially if you want to take care of our @@TODOs ;-)

If you would like to chat more you can usually find one of us on #drupal-geo on irc.freenode.net, or just post here.

Cheers,

Patrick

rsoden’s picture

Thanks Patrick!

If the approach seems sound and the code looks good, I'd say just commit it now. That way we can handle further adjustments/enhancements as smaller, more discrete patches.

Hoping to post another patch that allows marker style to be controlled via theme function sometime in the next few days.

Will look for you guys in #drupal-geo.

rsoden’s picture

StatusFileSize
new11.82 KB

I updated the patch to remove support for generic WKT. I'd like to add this back in at some point but removed it for 2 reasons:

1 - It wasn't finished. All functionality supplied by this patch should now work as advertised.
2 - I'd like to learn more about some of the issues Allie is running into with complex WKT and OpenLayers - #485886: Deprecating "WKT" default & #485856: Complex WKT values fail to render and see if I can find a generalized solution.

Let me know if there's anything else you need to get this committed.

zzolo’s picture

Title: Views support for multiple data storage options » Views Style Plugin

I reviewed and committed your patch, @rsoden. I think its a great direction. Thanks for the work. Some things I noticed of the plugin in general (not just these changes) when looking at it briefly.

* Other Lat/Lon did not recognize my Geo lat field.
* Behaviors did not work
* Behaviors need a title
* Tooltip does not seem to work
* Tooltip option is a single radio
* Try to support multiple data locations (not just one)
* Styles. This is a larger issue

Note that I may have to update Geo and may have to reset my dev environment. I have also not looked at the code as well as I should.

I am renaming this ticket and just making it the general Views Style Plugin discussion.

zzolo’s picture

Status: Needs review » Active
zzolo’s picture

Component: Code » OpenLayers Views
rsoden’s picture

zzolo,

Thanks for the commit. We're making progress and should have another patch for you to review soon but I wanted to respond to the points you raise above.

* Other Lat/Lon did not recognize my Geo lat field - By design, you shouldn't be able to select any Geo fields in the 'Other' columns. If users are looking to use data from the geo module, they should select the geo module as the data source. Is there another way you envision this working?

* I am not having any problems with behaviors or tooltips. Please let me know what you encountered here. Also, what do you mean by "Behaviors needs a title"?

* Re: Tooltips is a single radio checkbox. I agree this isn't ideal, but the patch provided here didn't change anything on this front. More themable, customizable tooltips is certainly something we're thinking about. Same with the styles point you raise. Let me know if you have any ideas on implementation for either of these.

* Multiple Data Sources - Agreed.

Also on the list:

* Linking points to nodes
* a resolution to tmcw's issue here: http://drupal.org/node/488738
* ability to turn on/turn off openlayers controls on a per view basis
* ability to set max/min zoom and bounds on a per view basis
* argument handling for bounds and default views

zzolo’s picture

Robert,

Yeah, I was just kind of just throwing out the things I saw at a glance, realizing that they were not necessarily caused by your patch.

It makes sense that you would not be using the Other Lat/Lon with Geo, at least in 99% of cases. But, in some random case there is the possibility of using the Lat coordinate from a Geo field and maybe a Lon coordinate from another field. Geo makes this format pretty easy. I guess it just doesn't seem like we actually need to restrict it. I don't feel that strongly on this, just throwing it out there.

As far as linking to nodes, it might be best to have an option that chooses whether the feature should go to the node (or whatever) or if it should open up a pop up.

All the other options will be covered by getting the settings form into the views plugin. The setting form needs some debugging, but I think its in a good place. In theory we should be able to just drop it in there, as that is the whole goal of the form and having an API around it.

Larger issues:

* Tooltips and Popups need some serious thought.
* Argument handling for map properties. This needs some good thought as well. It would definitely be awesome.
** Is this a new feature that we should not include in a 1.0?
** Is this easy to do?
** Can we just use the arguments tokens in the plugin settings, like you can do in fields?

rsoden’s picture

Good stuff,

* Geo Fields in "Other" dropdowns - This would actually take a bit of a rewrite as Geo Fields have to be handled specially in order to extract the WKT text. Not a huge time-sink and probably worth returning to in a few weeks, but given how unlikely the use-case is here, I think this is a low priority.

* Linking to Nodes/Popups/Tooltips - Other than #487144: Review Custom PHP-Based Styles in Views, this is at the top of my list.

* Options form - Let me know when you've got this to a point where you're happy and I'll move it over to the views interface. I think key things that are currently missing from the options form are: turning off controls and min/max zoom levels. I've got this working locally but can wait to submit a patch until the rest of the form is all set.

* Argument handling - We have something similar in Nicemap already and need this for a project that starts soon. Tom's working on it at the moment, so I'll let him post a patch and description when he's ready.

zzolo’s picture

Updated views plugin style options form (not any rendering logic). It is in a buggish state, but I have to get going and still want to put up the code for review:

* Changed around field names, specially "read_geo" to "data_source". We should avoid the use of "geo" unless specifically referring to geo module stuff
* Changed wording and interface
* Added ability to pick multiple data sources, but did not change rendering logic.

Issues/Bugs/Questions

* The new multiple select data source is not working correctly with the views dependency form logic stuff. If you select one, it will show the correct forms, but not if you select multiple.
* Settings form is not accounted for (not applied)
* Ahah, jquery, and CSS are not applied to the settings form, I think, because the way Views calls the options form, it's too late to add JS or CSS. Not sure how to fix this one.

Will try to work on this more this weekend.

Important to realize that any Geo module integration will change soon. (I think current logic does not support newest Geo)

tmcw’s picture

StatusFileSize
new1.41 KB

This patch accounts for the settings form - it's applied to produced maps.

tmcw’s picture

This applies settings, but I can't find out where the individually-set layers are applied to views, that might need to be built in...

zzolo’s picture

New archetecture in with map presets. Should be working much better now. Please test and let me know how it goes. I think the Views Plugin still needs some bug fixed with Styles, Data Features, and Popups.

zzolo’s picture

Status: Active » Fixed

Closing for now as this is a general topic. Please open any specific bug reports.

Status: Fixed » Closed (fixed)
Issue tags: -openlayers_views

Automatically closed -- issue fixed for 2 weeks with no activity.