I’m using ASP.NET MVC 3 Framework and I want to use Google Maps (v3) to display the location of my customers. I can take the value of their addresses/City from the database, but how can I combine these two? I’m using Razor engine.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are new to Google Maps I would suggest reading through their documentation and looking over the examples to get an idea on how the API works.
Another good tutorial to look at is the 4 guys from Rolla article on implementing a store locator application. The article was originally written in Web Forms and then later updated to MVC. There is relevant information in both. They do not use Razor views, but they do a good job at showing how to query the Google Maps API on the server side and packaging the results in a JSON object to display on the map.
Your View will be pretty simple if you just want markers on a map. The only HTML you would need is a div to store the map.