Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Google Maps Component MVC5

Posted on 2016-11-17
1
Medium Priority
?
98 Views
Last Modified: 2016-11-20
I'm currently using the Googlemap control component for Asp.NET MVC   to render maps from GoogleMaps.

I am using this component because I will have to trace the route of a vehicle coming from the database via model, then I will use the DataBinding option of the component.

The problem is that I'm using it inside a div with bootstrap.

<div class="col-md-10">
    <div class="content-box-header">
        <div class="panel-title">Mapa</div>
    </div>
    <div class="content-box-large box-with-header">
        <div id="map-canvas">


            @(Html.GoogleMap()
                  .Name("map")
                  .Width(750)
                  .Height(350)
                  .Zoom(18)
                  .MapTypeId(MapType.Satellite)
                  .Center(c => c.Latitude(-23.4554d)
                      .Longitude(-46.6257d))
                  .Culture(CultureInfo.GetCultureInfo("pt-BR"))
                  .Markers(marker =>
                  {
                      marker.Add()
                          .Latitude(-23.4554d)
                          .Longitude(-46.6257d)
                          .Title("Hello World!")
                          .Icon("~/Content/img/6.png", new Size(20, 32), new Point(0, 0), new Point(0, 32))
                          .Draggable(true);
                  }))
        </div>
    </div>
</div>

Open in new window


The bad thing is that the component needs me to tell the value of the height and width of the map to be rendered (Width, Height), then the map is no longer responsive.

Any way to calculate the div width / height value dynamically?

Or some other free component that you can use?
0
Comment
Question by:berechit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 41895150
I have no experience with this component (or even MVC for that matter) but when I click on the link you provided and go to the first example, it states you can use 0 for automatic width and height. Can you try that?
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Many of you may be aware of the recent Google Docs scam emails that have been floating around coming from various people that you know. Here's a guide on identifying How To Identify the Scam Email You will see an email from someone you’ve had co…
By using UNIQUE function in Google Sheets, you can get around removing duplicates like in Microsoft Excel.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question