|google maps||Bruce Wayne||7/25/11 4:29 AM|
I have some cards that contain location information: City, State, Zip,
Country, Address. I need to include a Google map for each card
Is there a document that gives instruction on how to integrate google
maps into the cards/wagn ?
|Re: google maps||rafael perez||9/5/11 11:39 PM|
Hi I am new around here...
I have been trying to integrate gmaps4rails into wagn (https://
gmaps4rails is coded for rails 3, but works in 2.x.x with some
in a card's view.
Thanks in advance
|Re: google maps||Rafael Perez||9/5/11 11:44 PM|
Sorry...I reported this message as spam by mistake...
|Re: wagn-dev + Re: google maps||Ethan McCutchen||9/6/11 8:02 AM|
One of the Wagneers, Wagn.org
Wagn. How pioneers roll.
|Re: wagn-dev + Re: google maps||Ethan McCutchen||9/13/11 12:37 PM|
Very interesting use case. Lots of different things to respond to.
Not sure all of that adds up to a cogent response. But I hope it helps keep you moving forward!
On Mon, Sep 12, 2011 at 10:24 AM, Rafael Perez <hdk...@gmail.com> wrote:
Gotta admit I have been enjoying wadding through your code :)
|Re: wagn-dev + Re: google maps||Rafael Perez||9/19/11 1:21 AM|
I got it working, I put everything in the naked view and now it works.
could be great to show a uneditable map in the naked view (markers,
routes, etc), and move to editor view to be able to change things.
Anyway, this is more than enough for now.
Thank you so much!
|Re: wagn-dev + Re: google maps||Ethan McCutchen||9/21/11 9:38 AM|
I'm cc'ing the dev list on my response because I think this gets to an important concept that we haven't really dug into enough as a group: what does "model" mean within Wagn.
When approaching models (in the MVC sense), there is a key difference between how wagn and more "normal" (in the idiomatic sense) rails applications: with Wagn, it's all one model. This is the low-level corollary of the idea that everything is a card.
We've given lots of attention to the many benefits of this unified approach, both for the present and for the future. A short list would include supporting extremely DRY (Don't Repeat Yourself) data, a very flexible query language, highly reusable interface components, a clear path towards data distribution, and expansive visualization potential.
But as often the case with breaking the mold, there are also some costs along the way. In this case, we lose some of the benefits built-in to rails for generating new models, because we generally don't want new models in the rails sense. We don't want new tables and new structures invisible to WQL. In fact, the thrust of our current development is about getting rid of rails models, so that ultimately we hope there will be only three: cards, references (an optimizated store of connections between cards), and changes (card history).
That said, we clearly do want to be able to create what we might call submodels: special views and behaviors that apply only to specific sets of cards.
The API for extending wagn in this way is moving forward rapidly, but it is still a work in progress. By Wagn 2.0, the answer to your question will be very simple: you just create a set module and use it to extend the views and behaviors of that set. From one set module you will be able to approach all three components of MVC to extend cards in that set:
We're not all the way there yet. The action (#3) component isn't available at all yet. The view (#2) component is there but is currently done through Renderer classes, not through set classes, in the packs directory. (We're going to unify those -- set modules and packs will essentially be the same thing, except that "packs" will be a wagneer level concept, whereas set module will refer explicitly to the code.)
And, finally, back to your question re models. The good news is that models are already extended through the set module, as they will be at 2.0. The bad news is that currently this method only works for extending one kind of set: types. You can see examples of this in use at /lib/wagn/set/type. All of the cardtype extensions for the types that come standard with new wagns are done in this way.
Gerry Gleason has been doing some great work on making set inclusion work for all kinds of sets (all, right, type plus right, star, etc), and this functionality will certainly be in place by 1.8, probably sooner.
In the meantime, if you really need to extend the model, the best solution is probably to try to solve your problem by creating a new cardtype and extending it as the other types. But I would also invite you to look closely at whether you really need new model behaviors or just new views of cards. If it's the latter, you might be able to do everything you need via packs.
On Wed, Sep 21, 2011 at 7:08 AM, Rafael Perez <hdk...@gmail.com> wrote: