Detalhe Hotel

  • Le Jardim

    1

    Line (circuit)

    1 City Center

    Bus Stop

Exception in template (Designs\AeroBus-Mobile\ItemPublisher/List/googleMapsCircuits.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.ceafdbc.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@{ var areaItem = Pageview.Area.Item; Dynamicweb.Content.Items.Item tempItem = new Dynamicweb.Content.Items.Item(); Dynamicweb.Content.Items.Item hotelItem = new Dynamicweb.Content.Items.Item(); List<LoopItem> lst_points = GetLoop("ItemPublisher:Items.List"); int num_index = 0; string str_noImage = areaItem["NoImage"].ToString(); string str_line = ""; string str_typePoint = ""; string str_latitude = ""; string str_longitude = ""; string str_hotelName = ""; string str_hotelAddress = ""; string str_translateLine = ""; string str_circuitDistance = ""; string str_circuitDuration = ""; string str_itemId = ""; if(lst_points.Count > 0) { <div id="mapCanvas"></div> } } @if (GetRequest("itemId") != null) { hotelItem = Dynamicweb.Content.Items.Item.GetItemById("LinesHotels", GetRequest("itemId").Split(':')[1].ToString()); str_hotelName = hotelItem["Name"].ToString(); str_hotelAddress = hotelItem["Address"].ToString(); str_line = hotelItem["Line"].ToString(); str_typePoint = hotelItem["TypePoint"].ToString(); str_latitude = hotelItem["Latitude"].ToString(); str_longitude = hotelItem["Longitude"].ToString(); str_circuitDistance = hotelItem["Distance"].ToString(); str_circuitDuration = hotelItem["Duration"].ToString(); str_itemId = hotelItem["BusStop"].ToString(); if(str_itemId != ""){ tempItem = Dynamicweb.Content.Items.Item.GetItemById("BusStop", str_itemId); } } @SnippetStart("jsVariables") var obj_mapSettings = { template_path:'@GetGlobalValue("Global:Request.Scheme")://@GetGlobalValue("Global:Request.Host")@str_noImage/', google_initLatLng:'@str_latitude,@str_longitude', google_zoom:15, google_mapId:'mapCanvas', google_fitBounds:false, google_filter:'all', google_markers:[], google_type:[], google_labels:{}, google_panY:0, google_waypointLines:[], google_parentArray:[], google_circuit:true, google_waypointLinesComplete:[], google_hotelCoords:"@str_latitude,@str_longitude" }; var num_index = 0; @foreach(var item in lst_points){ if(item.GetString("ItemPublisher:Items.List.LoopCounter") == str_line) { string str_pointType = str_line; <text> @foreach(var waypoint in item.GetLoop("ItemPublisher:Item.Waypoints")){ <text> obj_mapSettings.google_waypointLinesComplete.push({ lat : @waypoint.GetString("ItemPublisher:Item.Waypoints.Latitude.Value"), lng : @waypoint.GetString("ItemPublisher:Item.Waypoints.Longitude.Value") }); </text> } obj_mapSettings.google_type['1'] = { type_markers:[], type_name:'@areaItem["CompanyName"]' }; obj_mapSettings.google_parentArray[num_index] = obj_mapSettings.google_waypointLinesComplete; obj_mapSettings.google_waypointLinesComplete = []; num_index++; </text> } else { continue; } } @SnippetEnd("jsVariables") @SnippetStart("jsOnLoadVariables") @foreach(var item in lst_points){ if(item.GetString("ItemPublisher:Items.List.LoopCounter") == str_line) { num_index = 0; string str_pointType = str_line; foreach(var waypoint in item.GetLoop("ItemPublisher:Item.Waypoints")){ if(!waypoint.GetBoolean("ItemPublisher:Item.Waypoints.IntermediatePoint.Value")){ <text> obj_mapSettings.google_type['1'].type_markers.push({ marker_title:'@waypoint.GetString("ItemPublisher:Item.Waypoints.Name.Value")', marker_latlng:'@waypoint.GetString("ItemPublisher:Item.Waypoints.Latitude.Value"),@waypoint.GetString("ItemPublisher:Item.Waypoints.Longitude.Value")', marker_icon:{ image:'http://@GetGlobalValue("Global:Request.Host")/Files/Templates/Designs/Aerobus-Mobile/images/busMarker.png', width:38, height:51, originX:0, originY:0, anchorX:19, anchorY:25 }, marker_infoText:'' }); </text> num_index++; } } } } obj_mapSettings.google_type['1'].type_markers.push({ marker_title:'@str_hotelName', marker_latlng:'@str_latitude,@str_longitude', marker_icon:{ image:'http://@GetGlobalValue("Global:Request.Host")/Files/Templates/Designs/Aerobus-Mobile/images/hotelMarker.png', width:38, height:51, originX:0, originY:0, anchorX:19, anchorY:80 }, marker_infoText:'' }); @SnippetEnd("jsOnLoadVariables") @SnippetStart("jsOnLoad") onLoadGoogleMaps(obj_mapSettings); @SnippetEnd("jsOnLoad") <script type="text/javascript" src='https://maps.google.com/maps/api/js?sensor=false&amp;amp;[email protected]("Global:Area.Lang")'></script> @functions{ public static string GetRequest(string str_param = "") { var str_output = System.Web.HttpContext.Current.Request.QueryString[str_param]; return str_output; } }