记录自己工作中遇到的问题。
LayoutRoot.Background = new ImageBrush() { ImageSource = new BitmapImage(new Uri(string.Format(p, name, "gis/black.png"), UriKind.RelativeOrAbsolute)) };
LayoutRoot.Background = new SolidColorBrush(Color);
1、断点进不去。
解决方案:右击XXX.web---属性(Property)----左侧(Web),最下面,勾上Silverlight(默认只会勾上asp.Net).
2. 百度和谷歌地图关于根据经纬度定位出现偏差问题解决-有待测试,明天回公司测试后会做相应更改(此处为摘录)
baidu经纬度坐标与google经纬度坐标都是经过转换的。使用下面那个url可以将原始坐标或者谷歌的坐标转换成baidu的坐标
http://api.map.baidu.com/ag/coord/convert?from=0&to=4&x=116.308992&y=40.059225,将得到的base64字符,还原就是真实的经纬度。
将Base64编码的文本转换成普通文本
#region 将Base64编码的文本转换成普通文本
/// <summary>
/// 将Base64编码的文本转换成普通文本
/// </summary>
/// <param name="base64">Base64编码的文本</param>
/// <returns></returns>
public static string Base64StringToString(string base64)
{
if (base64 != "")
{
char[] charBuffer = base64.ToCharArray();
byte[] bytes = Convert.FromBase64CharArray(charBuffer, 0, charBuffer.Length);
string returnstr = Encoding.Default.GetString(bytes);
return returnstr;
}
else
{
return "";
}
}
#endregion
#region 字符串转为base64字符串
public static string changebase64(string str)
{
if (str != "" && str != null)
{
byte[] b = Encoding.Default.GetBytes(str);
string returnstr = Convert.ToBase64String(b);
return returnstr;
}
else
{
return "";
}
}
#endregion
请求接口中有四个参数:
其中,from和to对应的值分别是:0真实坐标;2google坐标;4baidu坐标。
from:被转换的坐标体系
to:转换到这个坐标体系
x:经度
y:纬度
接口应答中有三个key,
应答格式如:{"error":0,"x":"MTE2LjMyMTYyMzg4MjIz","y":"NDAuMDY2NDE2Mjc4NzMx"}
其中x和y就是所需要的值
不过该url好像有访问次数限制,具体还没测试出来。只能将其他坐标转成百度坐标,不能将百度转谷歌。
ArcGIS Server 10 许可文件 Ecp摘自博客园
3dengine,100,ecp.arcgis.server,none,KGE784S1MGRMMBKYZ161
3dserver,100,ecp.arcgis.server,none,VPH4ENBJ3Y831R1DF089
arcgisserver,100,ecp.arcgis.server,none,D7MFFAZ8THZTPJR67072
bingmapseng,100,ecp.arcgis.server,none,QH1N8J6BZM7PGTJ89232
bingmapssvr,100,ecp.arcgis.server,none,OLPF80PYJCNJJ7GPE158
businessvr,100,ecp.arcgis.server,none,UTE4AE2CXR2XYNEBB205
defenseintleng,100,ecp.arcgis.server,none,TRCZY4S1MGRMMBKYZ067
defenseintlsvr,100,ecp.arcgis.server,none,LHH9HK9J5ZA46EDPN164
defenseuseng,100,ecp.arcgis.server,none,UTF457E50KE00FH23148
defenseussvr,100,ecp.arcgis.server,none,LHH30H4CE00LTJT46024
designer,100,ecp.arcgis.server,none,TRBZMD18RMLSPF002054
gdbedit,100,ecp.arcgis.server,none,WEJFRRF0C6JCE3MXE079
geostatserver,100,ecp.arcgis.server,none,UTF654S1MGRMMBKYZ201
imageextserver,100,ecp.arcgis.server,none,HC4RTXLPE9JEE3CPR167
interopengine,100,ecp.arcgis.server,none,MJJAFH5G1E612RZFF118
interopserver,100,ecp.arcgis.server,none,VPF0TRFN61B75E5HJ074
jtxserver,100,ecp.arcgis.server,none,JFB157E50KE00FH23053
maplexengine,100,ecp.arcgis.server,none,LHH40XLPE9JEE3CPR159
networkengine,100,ecp.arcgis.server,none,YYPMSNCN82E8AZJTR206
networkserver,100,ecp.arcgis.server,none,PMYHHAY5RHHMF5KHT131
schematicengine,100,ecp.arcgis.server,none,YYPDCAZ8THZTPJR67200
schematicsvr,100,ecp.arcgis.server,none,PM0L8NAF20BTKXNCD158
spatialengine,100,ecp.arcgis.server,none,B5JA84S1MGRMMBKYZ159
spatialserver,100,ecp.arcgis.server,none,JFBXLD18RMLSPF002237
standardengine,100,ecp.arcgis.server,none,UTF750PYJCNJJ7GPE061
svradvanced,100,ecp.arcgis.server,none,UTE0RNBJ3Y831R1DF145
svrenterprise,100,ecp.arcgis.server,none,TRB6A7E50KE00FH23206
svrstandard,100,ecp.arcgis.server,none,A3C0LPJ0A5FBAZ8LN139
trackingengine,100,ecp.arcgis.server,none,VPF1RK8GZP4ZXNX8A052
virtualearthsvr,100,ecp.arcgis.server,none,FA0N5C04SE0H9KB10133
所有版权归小能所有哦!!!
/// <summary>
/// 点击某条记录,定位数据并显示Tips
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void QueryDetailsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
QueryResultData result = QueryDetailsDataGrid.SelectedItem as QueryResultData;
MessageBox.Show(result.SHAPE);
string[] xyPoint = result.SHAPE.Split(new Char[] { ',' });
double x = Convert.ToDouble(xyPoint[0]);
double y = Convert.ToDouble(xyPoint[1]);
ESRI.ArcGIS.Client.Geometry.MapPoint point = new ESRI.ArcGIS.Client.Geometry.MapPoint(x, y);
MyMap.PanTo(point);
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
//string[] gpsNMEASentence = gpsNMEASentenceArray[i].Split(',');
Graphic graphic = new Graphic()
{
Geometry = point,
Symbol = GlobePictureSymbol
};
graphicsLayer.Graphics.Add(graphic);
ESRI.ArcGIS.Client.Symbols.TextSymbol textSymbol = new ESRI.ArcGIS.Client.Symbols.TextSymbol()
{
FontFamily = new System.Windows.Media.FontFamily("Arial"),
Foreground = new System.Windows.Media.SolidColorBrush(Colors.Purple),
FontSize = 12,
Text = result.CN_NAME
};
Graphic graphicText = new Graphic()
{
Geometry = point,
Symbol = textSymbol
};
graphicsLayer.Graphics.Add(graphicText);
}
ArcGIS Server发布地图服务后无法显示问题解决(清除缓存):
输入:http://192.168.1.9/ArcGIS/rest/admin
输入用户名和密码
ArcGISWebServices 和 ***** , 进入后点击“Clear Cache Now”即可。