A few days ago Scott Hanselman posted about some cool mapping in mvc to add support for the DbGeography spatial types in MVC 4 when your are scaffolding the models and generating the views. You can read all about how Scott built a model binder for the datatype and created a editor and display template for it too using Google maps in his blog post.
Yesterday i thought i should try and add some of my code to the project that Scott is calling SpatialFun so you can opt in using Bing Maps and also get a little better user experience when editing/creating using the map for the DBGeography fields.
Some of the features i added were:
- The ability do drag a pushpin and update the location on the input field.
- Search module – let’s you reverse geocode the LatLong selected on the map and show a infobox with the readble address of the location your are dragging the pushpin.
Please take a look at my Bing Maps branch feel free to fork and submit pull requests.