26
TaffyDB so good!(Taiwan’s theater info on the Googlemap)
Posted by YuanYuanI have a project to make Taiwan’s movies theater show on Google Map. I got plain text data.
How do I convert this data on Googlemap?
1. I write a parse function to convert this plain text data to json string.
2. convert this json string to json format.
3. set this json to Taffy DB.
4. now you can useing SQL Tutorial like. example: here
5. I try to combined jQuery, jquery.fancybox, a little php, ajax, Json. mapiconmaker.js to do this.
now I finish Taiwan’s theater info on Google Map prototype. show example later.
in this project I get a little problem with php regular expression.
I try to parse plain text data, but some data format is movie_photos=http://xxx.com.tw/online/image.do?url=images/TWN_MOVIE/a12345.jpg
use
- list($qKey, $qVal) = preg_split("/=/", $element[ 'value' ]);
but get 2 item ? I just need only movie_photos=xxxxxxx until the end of line.
finally I fund this function set then fixed this problem.
- list($qKey, $qVal) = preg_split("/=/", $element[ 'value' ], 2, PREG_SPLIT_DELIM_CAPTURE);
why I use the TaffyDB ?
I think, if your data not too much, you can get all data at once. not alaways connect to server get data again. and Taffy DB have SQL tutorial like, support JSON, faster, good JSON control function…, that’s useful for me.
Taffy DB, was developed by Ian Smith.
what is Taffy DB ?(A JavaScript database for your browser)
Taffy DB is a free and opensource JavaScript library that acts as thin data layer inside Web 2.0 and Ajax applications.
What makes it cool:
10K file size!
Simple, JavaScript Centric Syntax
Fast
Easy to include in any web application
Compatible with major Ajax libraries: YUI, JQuery, Dojo, Prototype, EXT, etc
CRUD Interface (Create, Read, Update, Delete)
Sorting
Looping
Advanced Queries
Add A Comment