昨天晚上徹夜未眠,因為又在改程式了!!!
前幾天剛改好 slimbox wordpress plugin, 馬上就有人來發問,因為距離國考時間所剩無幾,原本無心多做回應,後來意外用 IE 測一下卻發現 javascript 似乎有問題,跑不起來。雖然在 Firefox, Opera 裡都正常,但要是 IE 這個市場主流軟體不能用,我的心血豈不就白費了!所以還是卯起來解決吧!
To cure sometimes, to relieve often, to comfort always.
昨天晚上徹夜未眠,因為又在改程式了!!!
前幾天剛改好 slimbox wordpress plugin, 馬上就有人來發問,因為距離國考時間所剩無幾,原本無心多做回應,後來意外用 IE 測一下卻發現 javascript 似乎有問題,跑不起來。雖然在 Firefox, Opera 裡都正常,但要是 IE 這個市場主流軟體不能用,我的心血豈不就白費了!所以還是卯起來解決吧!
UrMap is a web service which is just alike Google Maps and can show the map online. Besides these, it’s featured in the detailed street information and high-resolution satellite images of Taiwan, where I live. The API had been released for several days, but at first, I wasn’t very interested in it. After reading this post, I thought it may be fun to use the API displaying the address of some activities. Therefore, I tried it in the YMChmusic’s Blog.
But, WordPress has a feature that will add paragraph tags automatically to the content. When I tried to use javascript in the content, it didn’t work. The auto-paragraph mechanism is activated in the core of WordPress, and I couldn’t find any option to deactivate it. So, I gave it up.
Today, during the rest at noon, I tried again to search the documents of WordPress and found how to use javascript in the content. I had to install a plugin called Text Control, which can control the formatting behavior for a single post or globally. And then, I inserted the code into the post I’d like to show a map. Wow, I succeeded. Thanks, Jeff.
The second problem was that I had to find out the longitude and latitude of the place I wanted to display. The problem was resolved by a greasemonkey script called UrMap Plus 2.0. It can hybridize UrMap with Google Maps, and the most important is, the longitude and latitude information will be displayed. Thanks, CK.
With these two tools, I can show the map. But because the place I marked is a little remote, Map Mode doesn’t indicate it, although it’s very clear in the satellite image. Therefore, I’d like to change the default mode to Hybrid Mode, but there’s no documentation about this. The final method is to hack the source code, and fortunately I found a function called setMapType which is what I wanted. Thanks, myself. XD
Ok, this is the first time I use APIs. Maybe someday when I have more free time, I can investigate other APIs, such as Flickr’s and Google’s. It may be more fun. ^^