Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim WrHtmlCode,WrHtmlDir,WrHtmlName As String
Dim WrHtmlStart,WrHtmlStop,WrHtmlCenter As LatLng
Dim WrHtmlPoints As List
End Sub
Sub WriteInitHtml
Log("Html Start")
If WrHtmlPoints.Size>1 Then
WrHtmlCode = "<!DOCTYPE html><html><head><meta name='viewport' content='initial-scale=1.0, user-scalable=yes' /><style type='text/css'> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px }#map_canvas { height: 100% }</style><script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true'></script><script type='text/javascript'> function initialize() {var latlng = new google.maps.LatLng(" & WrHtmlCenter.Latitude & "," & WrHtmlCenter.Longitude & "); var myOptions = { zoom: 10, center: latlng, disableDefaultUI: true, zoomControl: true, scaleControl: true, scaleControlOptions: {position: google.maps.ControlPosition.TOP_LEFT}, mapTypeControl: true, mapTypeId: google.maps.MapTypeId.HYBRID }; var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions)"
'Startpunkt/Endpunkt mit Marker
WrHtmlCode = WrHtmlCode & "; var markerc = new google.maps.Marker({ position: new google.maps.LatLng(" & WrHtmlStart.Latitude & "," & WrHtmlStart.Longitude & "),map: map, title: '',clickable: false,icon: 'http://www.google.com/mapfiles/dd-start.png' })"
WrHtmlCode = WrHtmlCode & "; var markerc = new google.maps.Marker({ position: new google.maps.LatLng(" & WrHtmlStop.Latitude & "," & WrHtmlStop.Longitude & "),map: map, title: '',clickable: false,icon: 'http://www.google.com/mapfiles/dd-end.png' })"
WrHtmlCode = WrHtmlCode & "; var points = ["
WrHtmlCode = WrHtmlCode & " new google.maps.LatLng(" & WrHtmlStart.Latitude & "," & WrHtmlStart.Longitude & ")"
'Jeder einzelne Punkt hier dazu
For i = 2 To WrHtmlPoints.Size-1
Dim PointsTemp() As String = Regex.Split(",",WrHtmlPoints.Get(i))
WrHtmlCode = WrHtmlCode & ", new google.maps.LatLng(" & PointsTemp(0) & "," & PointsTemp(1) & ")"
Next
WrHtmlCode = WrHtmlCode & "] "
WrHtmlCode = WrHtmlCode & "; var polyline = new google.maps.Polyline({path: points, strokeColor: '#FF00FF',strokeOpacity: 0.5, strokeWeight: 3}); polyline.setMap(map); }</script></head><body onload='initialize()'> <div id='map_canvas' style='width:100%; height:100%'></div></body></html> "
Log("Html Stop")
Dim RouteName As String :RouteName=WrHtmlName
Dim RouteHtml As OutputStream
RouteHtml = File.OpenOutput(WrHtmlDir,WrHtmlName&".html",False)
RouteHtml.WriteBytes(WrHtmlCode.GetBytes("UTF8"),0,WrHtmlCode.GetBytes("UTF8").Length)
RouteHtml.Flush
RouteHtml.Close
End If
CallSub(Main,"progressDialogClose")
Return
End Sub