[RESOLVED]How to read a kml file (utf-8)
I need to read a kml file putting the contents into a string in order to send it to the google earth plugin.
eg
But it is not being accepted. IT should be the same as reading a HTML file i think.
I need to read a kml file putting the contents into a string in order to send it to the google earth plugin.
eg
I thought something like this would do it<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Simple placemark</name>
<description>Attached to the ground. Intelligently places itself
at the height of the underlying terrain.</description>
<Point>
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
</Point>
</Placemark>
</kml>
Code:
Dim oFSO As New FileSystemObject
Dim oFS
Set oFS = oFSO.OpenTextFile("C:\Documents and Settings\mch02080\Desktop\GoogleMapsVBexample\test.txt")
Do Until oFS.AtEndOfStream
KMLstring = KMLstring & vbCr & oFS.ReadLine
Loop
KMLstring = Right(KMLstring, Len(KMLstring) - 4)
Last edited: