⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gmaps.zul

📁 ZK是一个Ajax Java Web框架
💻 ZUL
字号:
<?xml version="1.0" encoding="UTF-8"?>

<!--
gmaps.zul

{{IS_NOTE
	Purpose:
		
	Description:
		
	History:
		Thu Oct 12 18:33:16     2006, Created by henrichen
}}IS_NOTE

Copyright (C) 2006 Potix Corporation. All Rights Reserved.

{{IS_RIGHT
}}IS_RIGHT
-->
<window title="Google Maps" width="605px">
	<zscript><![CDATA[
		String sn = Executions.getCurrent().getServerName();
		int sp = Executions.getCurrent().getServerPort();
		String gkey = null;
		if (sn.indexOf("www.potix.com") >= 0) { // http://www.potix.com/
			gkey="ABQIAAAAmGxmYR57XDAbAumS9tV5fxRYCo_4ZGj_-54kHesWSk0nMkbs4xTpq0zo9O75_ZqvsSLGY2YkC7jjNg";
		} else if (sn.indexOf("www.zkoss.org") >= 0) { // http://www.zkoss.org/
			gkey="ABQIAAAAmGxmYR57XDAbAumS9tV5fxQXyylOlR69a1vFTcUcpV6DXdesOBSMEHfkewcSzwEwBT7UzVx8ep8vjA";
		} else if (sn.indexOf("localhost") >= 0) { //localhost
			if (sp == 80) // http://localhost/
				gkey="ABQIAAAAmGxmYR57XDAbAumS9tV5fxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRUITTZ-rzsyEVih16Hn3ApyUpSkA";
			else if (sp == 8080) // http://localhost:8080
				gkey="ABQIAAAAmGxmYR57XDAbAumS9tV5fxTwM0brOpm-All5BF6PoaKBxRWWERSynObNOWSyMNmLGAMZAO1WkDUubA";
			else if (sp == 7799)
				gkey="ABQIAAAAmGxmYR57XDAbAumS9tV5fxTT6-Op-9nAQgn7qnDG0QjE8aldaBRU1BQK2ADNWCt1BR2yg4ghOM6YIA";
		}
	]]></zscript>
	<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=${gkey}"
	type="text/javascript" unless="${empty gkey}"/>
	<div style="border: 1px solid red;margin-top:10px;margin-bottom:20px" if="${empty gkey}">
		To use Google Maps for this site, you have to assign a proper Google Maps key for your site first.
		<toolbarbutton label="Sign up for a Google Maps API key" href="http://www.google.com/apis/maps/signup.html"/>
	</div>
<!-- 
	<window id="gmapwin" visible="false">
	<gmaps id="mymap" width="600px" height="350px" showSmallCtrl="true">
		<attribute name="onMapMove">
			mylat.setValue(self.getLat());
			mylng.setValue(self.getLng());
		</attribute>
		<attribute name="onMapZoom">
			myzoom.setValue(self.getZoom());
		</attribute>
		
		<ginfo id="myinfo" open="true">
			<attribute name="content"><![CDATA[
				Hello, <a href="http://www.zkoss.org">ZK</a>.
			]]></attribute>
		</ginfo>
		
		<gmarker id="mymark" lat="37.4410" lng="-122.1490">
			<attribute name="content"><![CDATA[
				Hello, <a href="http://www.zkoss.org">ZK</a> on top of Gmarker.
			]]></attribute>
		</gmarker>
	</gmaps>
	<grid>
	<rows>
		<row>Latitude: <doublebox id="mylat" value="${mymap.lat}" onChange="mymap.panTo(self.doubleValue(), mymap.getLng())"/></row>
		<row>Longitude: <doublebox id="mylng" value="${mymap.lng}" onChange="mymap.panTo(mymap.getLat(), self.doubleValue())"/></row>
		<row>Zoom Level: <intbox id="myzoom" value="${mymap.zoom}" onChange="mymap.setZoom(self.getValue())"/></row>
		<row>Open Info: <button label="Change" onClick="myinfo.isOpen() ? mymark.setOpen(true) : myinfo.setOpen(true)"/></row>
	</rows>
	</grid>
	</window>
-->
	<button label="show gmap" >
		<attribute name="onClick">
Window win = new Window("Window Title","normal",true);
win.setWidth("800px");
win.setHeight("600px");

Gmaps map = new Gmaps();
map.setWidth("100%");
map.setHeight("100%");
map.setParent(win);

win.setPage(page);
win.doModal();		
		</attribute>
	</button>
</window>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -