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

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - Calendar

windows平台下用C#访问HBase Hbase常用命令 CuteEditor测试 Windows 7使用问题 小问题之动态调用另一个程序集里的方法 GM的Hybrid 通过两个点的经纬度计算距离 地震了 下载试用IE 7.0 Beta 3.0 google maps可以支持地理信息查询了(附上功能介绍) - Calendar - 博客园 prototype理解 - Calendar - 博客园 google maps的脚本值得看看 - Calendar - 博客园 google卫星地图的url计算 linux下运行的eclipse的说明 用socket连接pop3服务器遇到的小问题 google maps又更新了 我是如何取得Reflector的真实程序的 对J2ME的想法 MiniQQ与LumaQQ
MapPoint批量导入Pushpin的方法 - Calendar - 博客园
Calendar · 2006-07-26 · via 博客园 - Calendar

MapPoint中常规方法插入Pushpin是:
MapPoint.Pushpin pii = map.AddPushpin(loc, "name1");
if(balloonState == 0)
 pii.BalloonState = GeoBalloonState.geoDisplayBalloon;
else if(balloonState == 1)
 pii.BalloonState = GeoBalloonState.geoDisplayName;
else
 pii.BalloonState = GeoBalloonState.geoDisplayNone;
pii.Symbol = symbol;
pii.Highlight = highLight;
pii.Note = "info1";
但这种方法地插入大量标记时速度非常慢,在4000个时大约需要9分钟。
机器配置是Pentium(R) D CPU 2.80GHz, 1.00GB内存。

在微软MapPoint论坛提问,回答说用VC写一个插件来批量插入Pushpin,可以避免Com/Interop的包装时间损耗,速度会快一些。
但那样的话,客户端布置麻烦。
因此,我试着用以下方式来提速。
如果不要求加亮或BalloonState,则速度更快,在5秒钟左右。

从数据库中读取数据并生成如下格式字符串,
其中, Name为pushpin的名称, info为提示字段, Latitude和Longitude为点的经纬度坐标

Name    Info    Latitude    Longitude
name1   info1    39.9456    75.0861
nam2     info2    39.9625    75.0875

再写一个函数实现导入pushpin功能, 并可以设定pushpin的符号, 是否加亮, 提示状态BalloonState.

protected bool ImportData(string content, int balloonState, bool highLight, short symbol)
{

    
construct the fields array

    
write temp file

    
import data and set pushpin features

}