- 浏览: 38790 次
- 性别:
- 来自: 呼和浩特
最新评论
-
yawen:
,很不错啊!
一个Flex做的天气预报widget -
zhanghan:
...
一个Flex做的天气预报widget -
KKD:
sheva.wen 写道@zhangcheng
感觉GWT还 ...
如何使用GWT-Ext 进行RIA开发 -
sheva.wen:
@zhangcheng
感觉GWT还有一段路要走,现在还不能 ...
如何使用GWT-Ext 进行RIA开发 -
zhangcheng:
我也比较喜欢gwt本身
如何使用GWT-Ext 进行RIA开发
下面要写的东西是一个使用GWT编写的在有限区域内通过拖动查看整个地图的简单实现。
一些细节:
- 为什么能拖?
com.google.gwt.user.client.ui.MouseListener 通过实现这个接口,可以实现UI对象对鼠标的Enter,Down,Leave,Move,Up动作的支持。
com.google.gwt.user.client.ui.FocusPanel 并不是每个UI对象都能够实现MouseListener接口的,可以通过添加到FocusPanel来实现。
- 怎么才能显示地图的局部,或者说怎么把其他部分藏起来?
通过样式:
java 代码
- DOM.setStyleAttribute(viewPortArea.getElement(), "overflow", "hidden");
- DOM.setStyleAttribute(viewPortArea.getElement(), "position","relative");
设置显示区域的"overflow"属性为"hidden"及"position"属性为"relative",图片可以实现局部显示显示框内。
代码:
java 代码
- package cn.gov.imwb.client;
- import com.google.gwt.user.client.DOM;
- import com.google.gwt.user.client.Event;
- import com.google.gwt.user.client.ui.AbsolutePanel;
- import com.google.gwt.user.client.ui.Composite;
- import com.google.gwt.user.client.ui.FocusPanel;
- import com.google.gwt.user.client.ui.Image;
- import com.google.gwt.user.client.ui.MouseListener;
- import com.google.gwt.user.client.ui.Widget;
- /**
- * @author sheva.wen
- *
- */
- public class MapViewerPanel extends Composite {
- public int areaHeight;
- public int areaWidth;
- public int centerLeft;
- public int centerTop;
- public int imageHeight;
- public String imageUrl;
- public int imageWidth;
- public int maxLeft;
- public int maxTop;
- public int minLeft;
- public int minTop;
- private Image image;
- private FocusPanel mouseListenerContainer;
- public double showPositionLeftRatio;
- public double showPositionTopRatio;
- private int startLeft;
- private int startTop;
- private int startX;
- private int startY;
- private int state = 0;//用于判断当前用户的鼠标动作
- private AbsolutePanel viewArea;
- private AbsolutePanel viewPortArea = new AbsolutePanel();
- /**
- *
- * @param areaWidth 显示区域的宽
- * @param areaHeight 显示区域的高
- * @param imageUrl 地图的链接
- * @param imageWidth 地图的宽
- * @param imageHeight 地图的高
- * @param showPositionLeftRatio 地图初始显示的位置 最左占宽度的比例
- * @param showPositionTopRatio 地图初始显示的位置 最上占宽度的比例
- */
- public MapViewerPanel(int areaWidth, int areaHeight, String imageUrl,
- int imageWidth, int imageHeight, double showPositionLeftRatio,
- double showPositionTopRatio) {
- mouseListenerContainer = new FocusPanel(viewPortArea);
- viewArea = new AbsolutePanel();
- /**
- * 将地图(图片)上的默认浏览器行为除去。
- */
- image = new Image(){
- /**
- * 这个部分必须紧跟在实例化过程的后面,不然就不起作用,没有在官方文档里找到原因。
- */
- public void onBrowserEvent (Event event)
- {
- DOM.eventPreventDefault(event);
- super.onBrowserEvent(event);
- }
- };
- viewArea.add(image);
- image.setPixelSize(imageWidth, imageHeight);
- image.setUrl(imageUrl);
- viewPortArea.setPixelSize(areaWidth, areaHeight);
- viewPortArea.addStyleName("viewportViewer");
- DOM.setStyleAttribute(viewPortArea.getElement(), "overflow", "hidden");
- DOM.setStyleAttribute(viewPortArea.getElement(), "position",
- "relative");
- initWidget(mouseListenerContainer);
- this.showPositionLeftRatio = showPositionLeftRatio;
- this.showPositionTopRatio = showPositionTopRatio;
- this.areaWidth = areaWidth;
- this.areaHeight = areaHeight;
- this.imageUrl = imageUrl;
- this.imageWidth = imageWidth;
- this.imageHeight = imageHeight;
- /**
- * 设置图片可被拖放的极限,防止图片被拖出边界
- */
- maxLeft = imageWidth - areaWidth;
- maxTop = imageHeight - areaHeight;
- minLeft = -(imageWidth - areaWidth);
- minTop = -(imageHeight - areaHeight);
- /**
- * 地图初始应该在的位置
- */
- centerLeft = (int) ((areaWidth - imageWidth) * showPositionLeftRatio);
- centerTop = (int) ((areaHeight - imageHeight) * showPositionTopRatio);
- viewPortArea.add(viewArea, centerLeft, centerTop);
- /**
- * 鼠标拖放的行为
- */
- MouseListener listener = new MouseListener(){
- public void onMouseDown(Widget sender, int x, int y) {
- state = 1;
- startX = x;
- startY = y;
- startLeft = viewPortArea.getWidgetLeft(viewArea);
- startTop = viewPortArea.getWidgetTop(viewArea);
- }
- public void onMouseEnter(Widget sender) {
- }
- public void onMouseLeave(Widget sender) {
- state = 0;
- DOM.setStyleAttribute(mouseListenerContainer.getElement(), "cursor", "default");
- }
- public void onMouseMove(Widget sender, int x, int y) {
- if(state == 1){
- DOM.setStyleAttribute(mouseListenerContainer.getElement(), "cursor", "move");
- if(viewPortArea.getWidgetLeft(viewArea) >= minLeft
- && viewPortArea.getWidgetLeft(viewArea) <= maxLeft
- && viewPortArea.getWidgetTop(viewArea) >= minTop
- && viewPortArea.getWidgetTop(viewArea) <= maxTop){
- viewPortArea.setWidgetPosition(viewArea,startLeft + (x - startX), startTop + (y - startY));
- }
- }
- }
- public void onMouseUp(Widget sender, int x, int y) {
- // TODO 缺报当拖放结束时,地图还在显示框内
- if(viewPortArea.getWidgetLeft(viewArea) < minLeft){
- viewPortArea.setWidgetPosition(viewArea, minLeft, viewPortArea.getWidgetTop(viewArea));
- }
- if(viewPortArea.getWidgetTop(viewArea) < minTop){
- viewPortArea.setWidgetPosition(viewArea, viewPortArea.getWidgetLeft(viewArea), minTop);
- }
- if(viewPortArea.getWidgetLeft(viewArea) > 0){
- viewPortArea.setWidgetPosition(viewArea, 0, viewPortArea.getWidgetTop(viewArea));
- }
- if(viewPortArea.getWidgetTop(viewArea) > 0){
- viewPortArea.setWidgetPosition(viewArea, viewPortArea.getWidgetLeft(viewArea), 0);
- }
- state = 0;
- DOM.setStyleAttribute(mouseListenerContainer.getElement(), "cursor", "default");
- }
- };
- mouseListenerContainer.addMouseListener(listener);
- }
- }
代码很容易理解,这只是一个很简易的实现,至少还有以下需要完善:
- 地图分块载入
- 支持鼠标滚轮的缩放
- “鹰眼”功能。
感兴趣的跟进一下:)
- MapViewer.rar (745.6 KB)
- 描述: Project(Eclipse下打开,须引入gwt-user.jar)
- 下载次数: 364
- Demo.rar (278.4 KB)
- 描述: Demo(解压后运行MapViewer.html查看效果)
- 下载次数: 489
评论
8 楼
darkfxux
2008-02-02
感兴趣,楼主如何EMAIL多少
7 楼
darkfxux
2008-02-01
邮箱多少,有写问题想问啊
6 楼
纯情小火鸡
2008-01-30
<div class='quote_title'>sheva.wen 写道</div><div class='quote_div'><p>下面要写的东西是一个使用GWT编写的在有限区域内通过拖动查看整个地图的简单实现。</p><p> <strong>一些细节:</strong></p><ol style='margin-right: 0px;'><li>为什么能拖? <p><span style='font-family: Arial;'><a href='http://code.google.com/webtoolkit/documentation/com.google.gwt.user.client.ui.MouseListener.html'>com.google.gwt.user.client.ui.MouseListener</a> 通过实现这个接口,可以实现UI对象对鼠标的Enter,Down,Leave,Move,Up动作的支持。</span></p><p><span style='font-family: Arial;'><span style='font-family: Arial;'><a href='http://code.google.com/webtoolkit/documentation/com.google.gwt.user.client.ui.FocusPanel.html'>com.google.gwt.user.client.ui.FocusPanel</a> 并不是每个UI对象都能够实现MouseListener接口的,可以通过添加到FocusPanel来实现。</span></span></p><span style='font-family: Arial;'/></li><li>怎么才能显示地图的局部,或者说怎么把其他部分藏起来? </li></ol><blockquote dir='ltr' style='margin-right: 0px;'><p dir='ltr'>通过样式:</p><div class='code_title'>java 代码</div><div class='dp-highlighter'><ol class='dp-j'><li class='alt'><span><span>DOM.setStyleAttribute(viewPortArea.getElement(), </span><span class='string'>"overflow"</span><span>, </span><span class='string'>"hidden"</span><span>); </span></span> </li><li><span> </span> </li><li class='alt'><span>DOM.setStyleAttribute(viewPortArea.getElement(), </span><span class='string'>"position"</span><span>,</span><span class='string'>"relative"</span><span>); </span> </li></ol></div><p>设置显示区域的"overflow"属性为"hidden"及"position"属性为"relative",图片可以实现局部显示显示框内。</p></blockquote><p dir='ltr'><strong>代码:</strong></p><blockquote dir='ltr' style='margin-right: 0px;'><div class='code_title'>java 代码</div><div class='dp-highlighter'><ol class='dp-j'><li class='alt'><span><span class='keyword'>package</span><span> cn.gov.imwb.client; </span></span> </li><li><span> </span> </li><li class='alt'><span class='keyword'>import</span><span> com.google.gwt.user.client.DOM; </span> </li><li><span class='keyword'>import</span><span> com.google.gwt.user.client.Event; </span> </li><li class='alt'><span class='keyword'>import</span><span> com.google.gwt.user.client.ui.AbsolutePanel; </span> </li><li><span class='keyword'>import</span><span> com.google.gwt.user.client.ui.Composite; </span> </li><li class='alt'><span class='keyword'>import</span><span> com.google.gwt.user.client.ui.FocusPanel; </span> </li><li><span class='keyword'>import</span><span> com.google.gwt.user.client.ui.Image; </span> </li><li class='alt'><span class='keyword'>import</span><span> com.google.gwt.user.client.ui.MouseListener; </span> </li><li><span class='keyword'>import</span><span> com.google.gwt.user.client.ui.Widget; </span> </li><li class='alt'><span> </span> </li><li><span class='comment'>/** </span> </li><li class='alt'><span><span class='comment'> * @author sheva.wen </span> </span> </li><li><span><span class='comment'> * </span> </span> </li><li class='alt'><span><span class='comment'> */</span><span> </span></span> </li><li><span class='keyword'>public</span><span> </span><span class='keyword'>class</span><span> MapViewerPanel </span><span class='keyword'>extends</span><span> Composite { </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> areaHeight; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> areaWidth; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> centerLeft; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> centerTop; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> imageHeight; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> String imageUrl; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> imageWidth; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> maxLeft; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> maxTop; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> minLeft; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>int</span><span> minTop; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> Image image; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> FocusPanel mouseListenerContainer; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>double</span><span> showPositionLeftRatio; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>double</span><span> showPositionTopRatio; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> </span><span class='keyword'>int</span><span> startLeft; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> </span><span class='keyword'>int</span><span> startTop; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> </span><span class='keyword'>int</span><span> startX; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> </span><span class='keyword'>int</span><span> startY; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> </span><span class='keyword'>int</span><span> state = </span><span class='number'>0</span><span>;</span><span class='comment'>//用于判断当前用户的鼠标动作 </span><span> </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> AbsolutePanel viewArea; </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>private</span><span> AbsolutePanel viewPortArea = </span><span class='keyword'>new</span><span> AbsolutePanel(); </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='comment'>/** </span> </li><li><span><span class='comment'> * </span> </span> </li><li class='alt'><span><span class='comment'> * @param areaWidth 显示区域的宽 </span> </span> </li><li><span><span class='comment'> * @param areaHeight 显示区域的高 </span> </span> </li><li class='alt'><span><span class='comment'> * @param imageUrl 地图的链接 </span> </span> </li><li><span><span class='comment'> * @param imageWidth 地图的宽 </span> </span> </li><li class='alt'><span><span class='comment'> * @param imageHeight 地图的高 </span> </span> </li><li><span><span class='comment'> * @param showPositionLeftRatio 地图初始显示的位置 最左占宽度的比例 </span> </span> </li><li class='alt'><span><span class='comment'> * @param showPositionTopRatio 地图初始显示的位置 最上占宽度的比例 </span> </span> </li><li><span><span class='comment'> */</span><span> </span></span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> MapViewerPanel(</span><span class='keyword'>int</span><span> areaWidth, </span><span class='keyword'>int</span><span> areaHeight, String imageUrl, </span> </li><li><span> </span><span class='keyword'>int</span><span> imageWidth, </span><span class='keyword'>int</span><span> imageHeight, </span><span class='keyword'>double</span><span> showPositionLeftRatio, </span> </li><li class='alt'><span> </span><span class='keyword'>double</span><span> showPositionTopRatio) { </span> </li><li><span> mouseListenerContainer = </span><span class='keyword'>new</span><span> FocusPanel(viewPortArea); </span> </li><li class='alt'><span> viewArea = </span><span class='keyword'>new</span><span> AbsolutePanel(); </span> </li><li><span> </span><span class='comment'>/** </span> </li><li class='alt'><span><span class='comment'> * 将地图(图片)上的默认浏览器行为除去。 </span> </span> </li><li><span><span class='comment'> */</span><span> </span></span> </li><li class='alt'><span> image = </span><span class='keyword'>new</span><span> Image(){ </span> </li><li><span> </span><span class='comment'>/** </span> </li><li class='alt'><span><span class='comment'> * 这个部分必须紧跟在实例化过程的后面,不然就不起作用,没有在官方文档里找到原因。 </span> </span> </li><li><span><span class='comment'> */</span><span> </span></span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>void</span><span> onBrowserEvent (Event event) </span> </li><li><span> { </span> </li><li class='alt'><span> DOM.eventPreventDefault(event); </span> </li><li><span> </span><span class='keyword'>super</span><span>.onBrowserEvent(event); </span> </li><li class='alt'><span> } </span> </li><li><span> </span> </li><li class='alt'><span> }; </span> </li><li><span> viewArea.add(image); </span> </li><li class='alt'><span> image.setPixelSize(imageWidth, imageHeight); </span> </li><li><span> image.setUrl(imageUrl); </span> </li><li class='alt'><span> </span> </li><li><span> viewPortArea.setPixelSize(areaWidth, areaHeight); </span> </li><li class='alt'><span> viewPortArea.addStyleName(</span><span class='string'>"viewportViewer"</span><span>); </span> </li><li><span> DOM.setStyleAttribute(viewPortArea.getElement(), </span><span class='string'>"overflow"</span><span>, </span><span class='string'>"hidden"</span><span>); </span> </li><li class='alt'><span> </span> </li><li><span> DOM.setStyleAttribute(viewPortArea.getElement(), </span><span class='string'>"position"</span><span>, </span> </li><li class='alt'><span> </span><span class='string'>"relative"</span><span>); </span> </li><li><span> initWidget(mouseListenerContainer); </span> </li><li class='alt'><span> </span> </li><li><span> </span> </li><li class='alt'><span> </span> </li><li><span> </span><span class='keyword'>this</span><span>.showPositionLeftRatio = showPositionLeftRatio; </span> </li><li class='alt'><span> </span><span class='keyword'>this</span><span>.showPositionTopRatio = showPositionTopRatio; </span> </li><li><span> </span><span class='keyword'>this</span><span>.areaWidth = areaWidth; </span> </li><li class='alt'><span> </span><span class='keyword'>this</span><span>.areaHeight = areaHeight; </span> </li><li><span> </span><span class='keyword'>this</span><span>.imageUrl = imageUrl; </span> </li><li class='alt'><span> </span><span class='keyword'>this</span><span>.imageWidth = imageWidth; </span> </li><li><span> </span><span class='keyword'>this</span><span>.imageHeight = imageHeight; </span> </li><li class='alt'><span> </span> </li><li><span> </span><span class='comment'>/** </span> </li><li class='alt'><span><span class='comment'> * 设置图片可被拖放的极限,防止图片被拖出边界 </span> </span> </li><li><span><span class='comment'> */</span><span> </span></span> </li><li class='alt'><span> </span> </li><li><span> maxLeft = imageWidth - areaWidth; </span> </li><li class='alt'><span> maxTop = imageHeight - areaHeight; </span> </li><li><span> minLeft = -(imageWidth - areaWidth); </span> </li><li class='alt'><span> minTop = -(imageHeight - areaHeight); </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='comment'>/** </span> </li><li><span><span class='comment'> * 地图初始应该在的位置 </span> </span> </li><li class='alt'><span><span class='comment'> */</span><span> </span></span> </li><li><span> centerLeft = (</span><span class='keyword'>int</span><span>) ((areaWidth - imageWidth) * showPositionLeftRatio); </span> </li><li class='alt'><span> centerTop = (</span><span class='keyword'>int</span><span>) ((areaHeight - imageHeight) * showPositionTopRatio); </span> </li><li><span> </span> </li><li class='alt'><span> viewPortArea.add(viewArea, centerLeft, centerTop); </span> </li><li><span> </span><span class='comment'>/** </span> </li><li class='alt'><span><span class='comment'> * 鼠标拖放的行为 </span> </span> </li><li><span><span class='comment'> */</span><span> </span></span> </li><li class='alt'><span> MouseListener listener = </span><span class='keyword'>new</span><span> MouseListener(){ </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>void</span><span> onMouseDown(Widget sender, </span><span class='keyword'>int</span><span> x, </span><span class='keyword'>int</span><span> y) { </span> </li><li><span> state = </span><span class='number'>1</span><span>; </span> </li><li class='alt'><span> startX = x; </span> </li><li><span> startY = y; </span> </li><li class='alt'><span> startLeft = viewPortArea.getWidgetLeft(viewArea); </span> </li><li><span> startTop = viewPortArea.getWidgetTop(viewArea); </span> </li><li class='alt'><span> </span> </li><li><span> } </span> </li><li class='alt'><span> </span> </li><li><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>void</span><span> onMouseEnter(Widget sender) { </span> </li><li class='alt'><span> </span> </li><li><span> } </span> </li><li class='alt'><span> </span> </li><li><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>void</span><span> onMouseLeave(Widget sender) { </span> </li><li class='alt'><span> state = </span><span class='number'>0</span><span>; </span> </li><li><span> DOM.setStyleAttribute(mouseListenerContainer.getElement(), </span><span class='string'>"cursor"</span><span>, </span><span class='string'>"default"</span><span>); </span> </li><li class='alt'><span> } </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>void</span><span> onMouseMove(Widget sender, </span><span class='keyword'>int</span><span> x, </span><span class='keyword'>int</span><span> y) { </span> </li><li><span> </span><span class='keyword'>if</span><span>(state == </span><span class='number'>1</span><span>){ </span> </li><li class='alt'><span> DOM.setStyleAttribute(mouseListenerContainer.getElement(), </span><span class='string'>"cursor"</span><span>, </span><span class='string'>"move"</span><span>); </span> </li><li><span> </span><span class='keyword'>if</span><span>(viewPortArea.getWidgetLeft(viewArea) >= minLeft </span> </li><li class='alt'><span> && viewPortArea.getWidgetLeft(viewArea) <= maxLeft </span> </li><li><span> && viewPortArea.getWidgetTop(viewArea) >= minTop </span> </li><li class='alt'><span> && viewPortArea.getWidgetTop(viewArea) <= maxTop){ </span> </li><li><span> viewPortArea.setWidgetPosition(viewArea,startLeft + (x - startX), startTop + (y - startY)); </span> </li><li class='alt'><span> } </span> </li><li><span> } </span> </li><li class='alt'><span> } </span> </li><li><span> </span> </li><li class='alt'><span> </span><span class='keyword'>public</span><span> </span><span class='keyword'>void</span><span> onMouseUp(Widget sender, </span><span class='keyword'>int</span><span> x, </span><span class='keyword'>int</span><span> y) { </span> </li><li><span> </span><span class='comment'>// TODO 缺报当拖放结束时,地图还在显示框内 </span><span> </span> </li><li class='alt'><span> </span><span class='keyword'>if</span><span>(viewPortArea.getWidgetLeft(viewArea) < minLeft){ </span> </li><li><span> viewPortArea.setWidgetPosition(viewArea, minLeft, viewPortArea.getWidgetTop(viewArea)); </span> </li><li class='alt'><span> } </span> </li><li><span> </span><span class='keyword'>if</span><span>(viewPortArea.getWidgetTop(viewArea) < minTop){ </span> </li><li class='alt'><span> viewPortArea.setWidgetPosition(viewArea, viewPortArea.getWidgetLeft(viewArea), minTop); </span> </li><li><span> } </span> </li><li class='alt'><span> </span><span class='keyword'>if</span><span>(viewPortArea.getWidgetLeft(viewArea) > </span><span class='number'>0</span><span>){ </span> </li><li><span> viewPortArea.setWidgetPosition(viewArea, </span><span class='number'>0</span><span>, viewPortArea.getWidgetTop(viewArea)); </span> </li><li class='alt'><span> } </span> </li><li><span> </span><span class='keyword'>if</span><span>(viewPortArea.getWidgetTop(viewArea) > </span><span class='number'>0</span><span>){ </span> </li><li class='alt'><span> viewPortArea.setWidgetPosition(viewArea, viewPortArea.getWidgetLeft(viewArea), </span><span class='number'>0</span><span>); </span> </li><li><span> } </span> </li><li class='alt'><span> state = </span><span class='number'>0</span><span>; </span> </li><li><span> DOM.setStyleAttribute(mouseListenerContainer.getElement(), </span><span class='string'>"cursor"</span><span>, </span><span class='string'>"default"</span><span>); </span> </li><li class='alt'><span> } </span> </li><li><span> </span> </li><li class='alt'><span> }; </span> </li><li><span> mouseListenerContainer.addMouseListener(listener); </span> </li><li class='alt'><span> </span> </li><li><span> } </span> </li><li class='alt'><span> </span> </li><li><span>} </span> </li></ol></div><p>代码很容易理解,这只是一个很简易的实现,至少还有以下需要完善:</p><ol><li>地图分块载入 </li><li>支持鼠标滚轮的缩放 </li><li>“鹰眼”功能。 </li></ol><p>感兴趣的跟进一下:)</p></blockquote></div>
5 楼
纯情小火鸡
2008-01-29
请问楼主 还有没有实现其他的功能了?比如加载地图图片 赢眼等的啊 能留下你的联系方式吗?
4 楼
sheva.wen
2007-10-02
@liuxyu
看不出什么,IE报错太恶心。
不想在这个问题上花时间了。
看不出什么,IE报错太恶心。
不想在这个问题上花时间了。
3 楼
liuxyu
2007-10-01
行: 3
字符: 39
错误: 尚未实现
代码: 0
我刚系统重装。tt版本可能有点老。2.02
不过之前的tt应该比较新
字符: 39
错误: 尚未实现
代码: 0
我刚系统重装。tt版本可能有点老。2.02
不过之前的tt应该比较新
2 楼
sheva.wen
2007-09-30
感兴趣就跟进以下:)
我用TT查看过了,好像没什么问题。
把脚本错误发来看看。
我用TT查看过了,好像没什么问题。
把脚本错误发来看看。
1 楼
liuxyu
2007-09-29
用GWT做google map我有兴趣。
先试了下你的demo。在滕讯浏览器下脚本错误,不能运行。IE下正常。
程序还没来得及看。
先试了下你的demo。在滕讯浏览器下脚本错误,不能运行。IE下正常。
程序还没来得及看。
相关推荐
MapViewer 是一款强大的地图可视化工具,它允许用户创建、编辑和展示地理信息数据。"mvdemo" 可能是 MapViewer 提供的一个演示或样本数据集,用于帮助用户了解如何使用该软件以及其功能。这个压缩包 "mvdemo11R1" 很...
在IT领域,尤其是在商业智能(BI)与地理信息系统(GIS)的交集上,Oracle Business Intelligence Enterprise Edition (OBIEE)与MapViewer的集成提供了一种强大的方式来展示和分析带有地理位置信息的数据。...
Mapviewer7.3 压缩包第三部分,全部上传完毕。
根据提供的文件信息,我们可以总结出以下关于Oracle MapViewer的相关知识点: ### 一、产品概述 **Oracle MapViewer** 是一款地图渲染工具,用于显示不同类型的地理空间数据。它作为Oracle Fusion Middleware的一...
Golden software 出品的一款酷软,用于地图的处理,功能强大,使用方便。
MapViewer与BIEE集成 之一MapViewer的安装和设置 MapViewer与BIEE集成 之二通过网页集成 MapViewer与BIEE集成 之三新地图文件向Oracle spatial数据库导入 MapViewer与BIEE集成 之四MapBuilder教程 MapViewer与BIEE...
### Oracle Spatial 与 MapViewer 新特性详解 #### 一、Oracle Spatial 11g 新特性概览 **Oracle Spatial 11g** 是 Oracle 数据库 11g 的一个重要组成部分,它引入了一系列重要的新特性,并对现有的特性和 API ...
知识点:Oracle MapViewer详解 一、Oracle MapViewer概述: Oracle MapViewer是Oracle Fusion Middleware套件中的一个关键组件,主要用于地理信息系统(GIS)和空间数据的可视化处理。它为用户提供了一个强大的平台...
MapViewer是一款强大的地理信息系统(GIS)软件,专用于地图制作、数据分析和可视化。在油田管理中,绘制开采现状图是至关重要的,它可以帮助我们理解油田的分布、开采进度以及资源利用情况。本教程将详细解释如何...
MapViewer与BIEE集成是将Oracle的GIS(地理信息系统)工具MapViewer与Business Intelligence Enterprise Edition(BIEE)相结合,以提供具有空间可视化能力的商业智能解决方案。Oracle Spatial是Oracle数据库的一个...
通过这个控件,我们可以加载Google Maps的网页,并在本地环境中展示地图。 **Google Map API的使用** Google Maps API是一组用于在网页和应用程序中嵌入地图、获取地理位置信息、绘制路线等功能的JavaScript库。在...
### 基于MapViewer的LBS系统设计与实现 #### MapViewer介绍及技术特性 MapViewer作为Oracle应用服务器10g的一个重要组件,主要用于可视化由Oracle Locator或Oracle Spatial管理的地理空间数据。该工具通过简化空间...
Oracle MapViewer 是 Oracle 11g 中的一个组件,主要用于创建、管理和展示地理空间数据。MapViewer 提供了一个直观的Web界面,使得用户可以方便地查看地图、地理信息以及相关的属性数据。这个“oracle11g配套...
【图形学MapViewer】是一个专注于地图可视化应用的项目,它允许用户通过图形界面来查看地图,并支持地图的拖动操作以实现平移查看。虽然开发者自谦表示功能并不完善,但这一工具对于学习和理解图形学原理,以及地图...
### OBIEE MapViewer 地图数据管理及GIS展示详解 #### OBIEE MapViewer概述 Oracle Business Intelligence Enterprise Edition (OBIEE) 提供了一系列强大的工具和服务,旨在帮助企业更好地理解和利用其业务数据。...
Mapviewer7.3 压缩包第二部分,一共三个压缩包;
地图浏览器Mapviewer是的抽象,可以使用配置创建常见的GIS应用程序。 Mapviewer需要npm install leaflet d3 d3-scale-chromatic mapviewer color npm install leaflet d3 d3-scale-chromatic mapviewer 。 < link...
MapViewer是一款专业的地形制作软件,广泛应用于地理信息系统(GIS)行业和教育领域。这款软件的主要功能是帮助用户创建、编辑和分析地图数据,特别是在地形建模方面表现出色。MapViewer 8.4.406是该软件的一个特定...
### ArcGIS.Engine.Demo.MapViewer知识点详解 #### 一、项目概述 **ArcGIS.Engine.Demo.MapViewer** 是一个基于ArcGIS Engine开发平台的应用程序示例。该项目主要目的是展示如何利用ArcGIS Engine的各种控件来构建...
【ArcGIS Engine Demo MapViewer】是一个面向初学者的ArcGIS二次开发示例,它通过MapViewer应用程序演示了如何使用ArcGIS Engine进行地图显示和交互的基本操作。ArcGIS Engine是Esri公司提供的一款强大的GIS开发工具...