Closed GoogleCodeExporter closed 9 years ago
Hey, nevermind; I just worked out what I can do (below). However, I think it
would
be great if you had another method (FetchKmlLocal) that would read it into a
tsream
like I am doing below. I think it would make a lot of people happy :-)
Again, keep up the good work!!!
geWebBrowser.FetchKml(C:\\test.kml);
FileStream stream = File.Open(textBox1.Text, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(stream);
IKmlObject kml = ge.parseKml(sr.ReadToEnd());
ge.getFeatures().appendChild(kml);
sr.Close();
stream.Close();
Original comment by gordon_m...@hotmail.com
on 10 Oct 2009 at 11:00
Thanks for this, I will add it in the next commit. Just to note I have amended
the
function like so...
{{{
public void FetchKmlLocal(string path)
{
if (File.Exists(path) && path.EndsWith("kml", true,
System.Globalization.CultureInfo.CurrentCulture))
{
try
{
FileStream stream = File.Open(path, FileMode.Open, FileAccess.Read);
StreamReader reader = new StreamReader(stream);
IKmlObject kml = geplugin.parseKml(reader.ReadToEnd());
external.LoadKmlCallBack(kml as IKmlFeature);
}
catch (FileNotFoundException fnfex)
{
Debug.WriteLine(fnfex.ToString());
throw;
}
catch (UnauthorizedAccessException uaex)
{
Debug.WriteLine(uaex.ToString());
throw;
}
catch (COMException cex)
{
Debug.WriteLine(cex.ToString());
throw;
}
}
}
}}}
Original comment by fraser.c...@gmail.com
on 12 Oct 2009 at 12:50
Ok it is in, thanks again :D
Original comment by fraser.c...@gmail.com
on 12 Oct 2009 at 1:02
That's excellent! One thing I just noticed to be an issue as well though is
that my
KML file specifies some icons to use on my machine and those don't show up for
the
same reason I guess - webBorwser not allowed access LOL. Arrghh. I will let you
know
if I find a solution, but it doesn't look like an easy one. Maybe you have some
ideas?
Original comment by gordon_m...@hotmail.com
on 12 Oct 2009 at 7:56
See http://code.google.com/p/winforms-geplugin-control-library/wiki/Server
Original comment by fraser.c...@gmail.com
on 26 Nov 2009 at 4:25
Awesome! Thanks for your hard work!
Original comment by gordon_m...@hotmail.com
on 28 Nov 2009 at 2:06
Original issue reported on code.google.com by
gordon_m...@hotmail.com
on 10 Oct 2009 at 10:35