使用XML做数据库与JS的中介比PHP直接输出好

7 篇文章 0 订阅

用 PHP 做 google Map 程序的教程中有一段。

大概意思是说有些教程让你用PHP写JS来创建Google Map程序,但是这样问题很多。

使用 XML 文件作为连接数据库和Google Map 的中介,将使地图网页初始化更快,可以创建更灵活的地图程序,调试也更方便。你可以单独的验证XML输出。甚至你可以完全忽略数据库只用XML运行你的地图。

 

上午看了一个开源PHP类phoogle,它是一个PHP创建Google Map 的类,调试中出现一些问题,正如这段文章所说一样。

 

文章来源:http://code.google.com/support/bin/answer.py?answer=65622


Note: Some tutorials may suggest actually writing your map page as a PHP file and outputting JavaScript for each marker you want to create, but that technique can be problematic. By using an XML file as an intermediary between our database and our Google Map, it makes for a faster initial page load, a more flexible map application, and easier debugging. You can independently verify the XML output from the database and the JavaScript parsing of the XML. And at any point, you could even decide to eliminate your database entirely and just run the map based on static XML files.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值