jmelosegui / GooglemapMvc

The control wraps Google maps API simplifying the use of Google maps in ASP.NET MVC applications.
MIT License
116 stars 61 forks source link

Google Map and displaying icon images #77

Closed maxitimes closed 9 years ago

maxitimes commented 9 years ago

Hi there, love you GooglemapMvc, just having one problem, display icon's on maps but only when trying to display multiple points when data binding to a model

Visual Studio 2015

@using Jmelosegui.Mvc.GoogleMap
...
...
...
                binding => binding.ItemDataBound
                    (
                        (marker, geoLocation) =>
                        {
                            marker.Latitude = geoLocation.Latitude;
                            marker.Longitude = geoLocation.Longitude;
                            marker.Title = geoLocation.Title;
                            marker.ZIndex = geoLocation.zIndex;
                            marker.Icon = new MarkerImage(String.Format("~/Content/icon/{0}", geoLocation.ImagePath)
                                , new Size(32, 32)
                                , new Point(0, 0)
                                , new Point(0, 0));
                            marker.Window = new InfoWindow(marker)

Now if i remove the "marker.Icon" line and data the map and points display, but if i try and add the markers i get this error

jmeloseguimap

Any assistance appreciated

Thanks

maxitimes commented 9 years ago

ok found it, binding example missing the @using System.Drawing

all good