惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
雷峰网
雷峰网
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
D
DataBreaches.Net
量子位
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
人人都是产品经理
人人都是产品经理
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
Help Net Security
Help Net Security
腾讯CDC
I
InfoQ
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
W
WeLiveSecurity
NISL@THU
NISL@THU
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
月光博客
月光博客
Schneier on Security
Schneier on Security
Forbes - Security
Forbes - Security
Project Zero
Project Zero
宝玉的分享
宝玉的分享
P
Palo Alto Networks Blog
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
S
Security Affairs
I
Intezer
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
A
Arctic Wolf
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
T
Tenable Blog
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - protorock

WPF:通过Window.DataContext实现窗口间传值 How to add dependency on a Windows Service AFTER the service is installed 实现泛型IEnumerable接口 关于Local System/Local Service/Network Service账户 vs2010 c# 管理win7防火墙 WIN7系统中连接点(Junction Points) 程序集强名称(Strong Name)延迟签名与签名 VISUAL STUDIO 2010 单元测试 Windows Server 2008 R2上Ext.net 生产环境搭建 在Windows7 (SP1)配置IIS7.5 + .Net Framework 4.0.30319 将Google Map 与ASP.NET AJAX 扩展集成 web.config 加密步骤 - protorock - 博客园 GridView 与自定义对象的绑定和分页 在Windows 2003 中发布 ASP.NET 2.0 + SQL SERVER Express SQL Server 2005 Express Edition 用户实例 在 windows2003 Server VS2005 安装 .Net 3.0 .net framework 2.0,3.0与3.5之间的关系 Sharpmap AjaxMapControl 分析 HTTP 协议概要(二) 持久连接
SharpMap AjaxMapControl 中 Zoomin/Zoomout 操作时冻结问题
protorock · 2007-06-13 · via 博客园 - protorock

1、现象:
在放大/缩小操作时,当 Map.width = Map.MaximumZoom 时再次执行Zoomout  或者当 Map.width = Map.MinimumZoom 时再次执行Zoomin,浏览器显示的地图处于冻结状态(刷新地图停止);同时,鼠标光标处于长久的等待(wait)状态。

2、原因:
客户端 javascript 脚本在响应鼠标事件处理时发生事件重入。 

3、解决方法:
修改AjaxMap.js 中的SharpMap_BeginZoom 函数
function SharpMap_BeginZoom(obj,x,y,zoomval)
{
 if(obj.zoomEnded==0) return;
 if(obj.zoom/zoomval<obj.minZoom) zoomval = obj.zoom/obj.minZoom;
 if(obj.zoom/zoomval>obj.maxZoom) zoomval = obj.zoom/obj.maxZoom;

 //当控制动态缩放的zoomval值为1时停止动态缩放并退出
 if(Math.abs(1-zoomval)<0.0001) return;
 obj.zoomEnded=0;
 obj.container.style.cursor = 'wait';
 var position = WebForm_GetElementPosition(obj.container);
 var imgX = x-position.x;
 var imgY = y-position.y;
 var center = SharpMap_PixelToMap(imgX+(obj.container.offsetWidth*0.5-imgX)/zoomval,imgY+(obj.container.offsetHeight*0.5-imgY)/zoomval,obj);
 obj.zoom = obj.zoom/zoomval;
 obj.minX = center.x - obj.zoom*0.5;
 obj.maxY = center.y + obj.zoom*obj.container.offsetHeight/obj.container.offsetWidth*0.5;
 SharpMap_BeginRefreshMap(obj,1); //Start refreshing the map while we're zooming
 SharpMap_DynamicZoom((position.x-x)*(zoomval-1),(position.y-y)*(zoomval-1),zoomval,0.0,obj);
}

4、修改后的测试结果:
a) 解决了鼠标 Click 缩放操作冻结问题;
b) 鼠标滚轮缩放操作仍有冻结(原因猜测中……);