Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard Marker in Google Maps too small

i am implementing a Location Picker like this one: http://m.rhinvivant-lebendigerrhein.eu/geopick.php?raz=1

But when I load the code in my environment the Location Marker is suddenly small and squashed after loading the page (see image1). Then after i dragged the Marker around, it gets even smaller (see image2).

google maps marker too small

Has anyone seen something like this? It would help to get a hint how i can work around this, or what mistake i made.

i.e. How can i fix the size of my markers?

My code looks like this:

var marker = new google.maps.Marker({
    title: settings.gMapMarkerTitle,
    map: map,
    position: defaultLocationLatLng,
    draggable: true
});
like image 675
patrics Avatar asked Sep 19 '12 11:09

patrics


People also ask

How do I change the format of Google Maps?

In the Google Cloud Console, go to the Map Styles page. Select the style you want, and click Customize Style.

Which is the preferred method for handling large numbers of markers is to store the data in?

As it turns out, the Android Maps Util Library https://github.com/googlemaps/android-maps-utils seems to be the number one choice when clustering markers.


1 Answers

The Problem was indeed a CSS setting. I am using the zurb foundation framework, which defines max-width for all images.

max-width: 100%;

Fixed it, by adding my own css class to the map div. It overrides the max-width setting and the Markers are back to normal.

<div id="gmap" class="map_canvas" />

.map_canvas img {
    max-width: none; // just in case it does not work... add !important;
}

Thanks Dr. Molle for the Hint...

like image 137
patrics Avatar answered Oct 07 '22 03:10

patrics