title: Customized google maps marker icon not showing in partial view
body: <p>Something strange ( at least for me) is happening. I have a partial view that is showing  a couple of google map markers. However as soon as I use my own customized icon if refuses to display. But when I give my route in the RegisterRoutes function of global.asax.cs for instance like so</p>
  
  <pre><code>   routes.MapRoute(
                  "Default", // Route name
                  "{controller}/{action}/{id}", // URL with parameters
                  new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
              );
  </code></pre>
  
  <p>And if my partial view is in Index view ,it for reasons unknown to me decides to show itself? 
  Why is this and how is this solvable? </p>
  
  <p>Update (code):
  This is my code in the partial view called MapResults.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      var geocoder;
      var map;
      function initialize() {
          geocoder = new google.maps.Geocoder();
          var latlng = new google.maps.LatLng(-34.397, 150.644);
          var myOptions = {
              zoom: 8,
              center: latlng,
              mapTypeId: google.maps.MapTypeId.ROADMAP
          }
          map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
          collectingData();
          google.maps.event.addListener(map, 'click', function() {
  
          });      
     } 
  
      function codeAddress(location, name, contract) {
          var address = location;
          var infowindow;
          var image;
          geocoder.geocode({ 'address': address }, function (results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                      map.setCenter(results[0].geometry.location);
  
                       var image = new google.maps.MarkerImage(returnImage(contract),
                        // This marker is 20 pixels wide by 32 pixels tall.
                        new google.maps.Size(30, 42),
                        // The origin for this image is 0,0.
                        new google.maps.Point(40,45),
                        // The anchor for this image is the base of the flagpole at 0,32.
                        new google.maps.Point(0, 32));
  
                      var marker = new google.maps.Marker({
                      map: map,
                    //  icon: image,   only showing when registered in global asax
                      position: results[0].geometry.location,            
                  });
  
            infowindow = new InfoBox(infoboxOptions(boxText(name, contract)));
                       google.maps.event.addListener(marker, 'click', function() {
                      infowindow.open(map, marker);
                       });
              } else {
                  alert("Geocode was not successful for the following reason: " + status);
              }   
          });               
      }
  </code></pre>
  
  <p>These are my most important functions. </p>
  
  <p>This is a view that is using my partial view </p>
  
  <pre><code>@model IPagedList&lt;HospitalSearch.Models.Buildings&gt;
  
  @{
     ViewBag.Title = "Map";
  
  }
           &lt;div&gt;     
              @Html.Partial("MapResults")
          &lt;/div&gt;
  
    @foreach (var item in Model) {
          &lt;input id="adres" type="hidden" value=@Html.DisplayFor(modelItem =&gt; item.StreetBuilding) @Html.DisplayFor(modelItem =&gt; item.NumberBuilding) /&gt;  
    }
  
    &lt;/body&gt;
  &lt;div class="pager"&gt;
      @Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount)
  &lt;/div&gt;
  </code></pre>
  
  <p>Having it in RegisterRoutes will show as wanted otherwise it will not.
  Update: 
  It turns out RegisterRoutes is somehow getting the  "correct" url to my image. If I use a direct path say <a href="http://localhost:8080/Content/image.png" rel="nofollow">http://localhost:8080/Content/image.png</a>  then everything is fine. 
  However "Content/image.png" does not work. If I figure out what exactly happens I'll update of course. </p>