0
当我手动提供数值(纬度和经度)时,图钉工具未找到位置。图钉不能定位在bing地图
这里是我的代码:
double dbllat = 13.060407;
double dbllong = 80.249562;
Pushpin mypin = new Pushpin();
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
watcher.MovementThreshold = 40;
watcher.Start();
watcher.Position.Location.Latitude = dbllat;
watcher.Position.Location.Longitude = dbllong;
mypin .Location.Latitude = dbllat;
mypin .Location.Longitude = dbllong;
//CredentialsProvider cp=
map1.Center = new GeoCoordinate(mypin.Location.Latitude, mypin.Location.Longitude);
map1.SetView(mypin .Location, 5.0);
push.Tag = "Location";
push.Content = "i'm here";
map1.Children.Add(mypin);
watcher.Stop();
什么可能我是做错了什么?
哎呀,你需要做什么?查找当前位置或显示固定位置(13.060407,80.249562)? –
GeoCoordinateWatcher是异步的。你需要听PositionUpdated。 –