本文件將介紹如何在Plone上使用Google maps。



要在Plone安裝Google maps現在是個很簡單的事情,透過buildout可以很輕易的達成。首先開啟buildout.cfg,通常在 /Plone安裝目錄/zeocluster/底下,找到eggs那段,並在下面加入 Products.Maps,大概會像這個樣子:
eggs =
    ${plone:eggs}
    ${buildout:eggs}
    Products.Maps

之後存檔後,執行一次bin/buildout:

[root@localhost zeocluster]# bin/buildout
Uninstalling zopepy.
Uninstalling client2.
Uninstalling client1.
Updating plone.
Updating zope2.
Updating productdistros.
Updating zeoserver.
Installing client1.
Getting distribution for 'Products.Maps'.
Got Products.Maps 2.0.
Generated script '/opt/Plone-3.1/zeocluster/bin/client1'.
Installing client2.
Generated script '/opt/Plone-3.1/zeocluster/bin/client2'.
Installing zopepy.
Generated interpreter '/opt/Plone-3.1/zeocluster/bin/zopepy'.
Updating chown.
chown: Running
chmod 600 .installed.cfg
touch /opt/Plone-3.1/zeocluster/var/log/zeoserver.log
find /opt/Plone-3.1/zeocluster -type d -name var -exec chown -R plone \{\} \;
find /opt/Plone-3.1/zeocluster -type d -name LC_MESSAGES -exec chown -R plone \{\} \;
find /opt/Plone-3.1/zeocluster -name runzope -exec chown plone \{\} \;
Updating unifiedinstaller.
Updating precompile.
  precompiling python scripts in /opt/Plone-3.1/zeocluster/products
  precompiling python scripts in /opt/Plone-3.1/zeocluster/parts/productdistros
  precompiling python scripts in /opt/Plone-3.1/zeocluster/parts/plone


這時Google maps便以經安裝到Plone裡了。建議將Plone shutdown之後在啟動一次。接著到Plone控制台的Add-on Products就會看到Maps 2.0的安裝選項,請把它打勾安裝:

1.png

到Plone site裡會看到Maps的管理選項,點選進入管理介面:

2.png

 

進去之後會看見 Google Maps API Key的選項,在這裡必須自己去申請一個Google Maps API Key來使用(底下介紹),之後把你的URL與key輸入進去就可以了:

3.png

 

之後再Plone裡就可以使用Google Maps了:


4.png




申請Google Maps API key
申請網址:http://code.google.com/intl/zh-TW/apis/maps/signup.html,進去之後看完說明後,在最下面,第一行勾選起來,第二行輸入你的URL,最後按下Generate API Key就會show出你的key了:



5.png





參考文件
http://yenjinc.info/?p=405
http://pypi.python.org/pypi/Products.Maps/2.0


f
創作者介紹
創作者 xiangyang17 的頭像
xiangyang17

xiangyang17

xiangyang17 發表在 痞客邦 留言(0) 人氣()