google maps vol#2

A place for users and developers of the Xataface to discuss and receive support.

Postby maddin » Tue Jul 10, 2007 12:35 pm

hi steve
I'd like to ask you some questions about implementing a google map, used as an input device for Dataface.
The user should get the possibility to draw their tracks directly on the map like in this example: http://maps.forum.nu/gm_plot.html
The google maps code is a mixture of javascript functions and html and for the display of polylines a different doctype has to be used
eg:
I would like to use the dataface permissions framework for this specific form. I was looking at the quickform extensions you wrote , for example how you implemented the wysiwyg editor , but that is far beyond my coding skills, and since this a input device which is not used that often there is no need to implement it as elegant as you implemented the tiny_mce. To make a long Story short...for an outline of a geo form like this, where would you place the code? Does it make sense to seperate the html from the javascript? ...If you don't tell me that this is a stupid idea some more questions might follow...;)
cheers martin
maddin
 
Posts: 58
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Jul 10, 2007 5:02 pm

Hi Martin,

All I can say is this is a really cool idea. You can either do this as a custom action or create a widget. The next release of Dataface has been completely refactored to allow the creation of custom widgets more modularly than before -- but custom widgets would still require some PHP coding.

The easier way, right now, would probably be to create a custom action for this. Then you could almost copy and paste the proper HTML and javascript into a template. And you could limit access to the action with dataface permissions. You'd probably create a permission called 'draw tracks' in the permissions.ini file, then make this a required permission for your 'draw_tracks' action.

e.g. permissions.ini :

draw tracks="Draw tracks with google maps"

e.g. actions.ini

[draw_tracks]
...
permission=draw tracks

If you wanted to implement it as a widget, then a good place to start would be by copying one of my custom widgets in the HTML/QuickForm directory. (e.g. calendar.php or htmlarea.php -- or any of the other widgets for that matter). The important thing is the toHtml() method which outputs the HTML to render the component...

But this can get pretty complicated.

I apologize for the vagueness and brevity of answers in this post... hopefully it makes some sense.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved