private string BuildHtml()
{
if (_operation != null)
{
StringBuilder builder = new StringBuilder();
if (!_operation.Einsatzort.HasGeoCoordinates)
{
return "<h2>Konnte Geocodes fuer Zielort nicht bestimmen! Ggf. ist der Geocoding Job nicht aktiv?</h2>";
}
string variables =
"directionsDisplay = new google.maps.DirectionsRenderer();" +
"var zoomOnAddress = " + _configuration.ZoomOnAddress.ToString().ToLower() + ";" +
"var dest = new google.maps.LatLng(" + _operation.Einsatzort.GeoLatitudeString + "," + _operation.Einsatzort.GeoLongitudeString + ");" +
"var home = '" + _configuration.Home + "';" +
"var ZoomLevel =" + (_configuration.ZoomLevel / 100.0D).ToString(CultureInfo.InvariantCulture) + ";" +
"var mapType = google.maps.MapTypeId." + _configuration.Maptype + ";" +
"var mapOptions = {" +
"zoom: 10," +
"overviewMapControl: true," +
"panControl: false," +
"streetViewControl: false," +
"ZoomControl: " + _configuration.ZoomControl.ToString().ToLower() + "," +
"mapTypeId: mapType" +
"};" +
"map = new google.maps.Map(document.getElementById(\"map_canvas\")," +
"mapOptions);";
builder.AppendLine(BeginnHead);
builder.AppendLine(variables);
builder.AppendLine(_configuration.Route ? Showroute : CenterCoord);
if (_configuration.Tilt)
{
builder.AppendLine(Tilt);
}
if (_configuration.Traffic)
{
builder.AppendLine(Traffic);
}
builder.AppendLine("}");
if (_configuration.Route)
{
builder.AppendLine(RouteFunc);
}
builder.AppendLine(EndHead);
builder.AppendLine(Body);
return builder.ToString();
}
return string.Empty;
}