I am creating a maps plugin for Wordpress that uses Google Maps JS API
V3. Commonly the maps will be embedded within a wordpress post that
has images that are styled. This actually happens in one of the most
popular themes TwentyEleven.

.entry-content img,
.comment-content img,
.widget img {
 max-width: 97.5%; /* Fluid images for posts, comments, and widgets */
}

This has been posted about, not a ton but people have had to deal with
it. So I have researched this.

http://wordpress.org/support/topic/twenty-eleven-12-breaks-embedded-google-maps

http://wpscale.com/google-street-map-cant-work-in-wordpress-3-2/

Every post I have seen on this subject provides the solution of
changing the class styling for the div being used:

.wl_places_place_map_canvas img {
max-width: none;
}

This looks better, it really does. I am not finding a solution that
makes it look great though. There are two effects from this solution
that are not desirable.

1. Sometimes on backgrounded tile load the styling override doesn't
actually work.
2. There is still visible 1px tile gapping that actually gaps marker
overlays if they happen to be on tile lines.

To deal with the backgrounded style issue I have attempted to use
jQuery, and make sure all tiles are loaded prior to setting the style:

google.maps.event.trigger(_instance._map, 'resize');
var listener = google.maps.event.addListener(_instance._map,
"tilesloaded", function() {
 jQuery('.wl_places_place_map_canvas').find('img').css('max-
width','none');
 google.maps.event.removeListener(listener);
});

That deals with the first issue, not the second and 1px tile gaps
still are visible on the map and overlays.

What I want is a 100% bulletproof way to force style on the map. I
have researched the API extensively. What I would really like is a way
to set the style on the map itself, hopefully as a URL, and it would
ignore and override all external styles. In the best possible world
this style would live in Google's CDN and be tested to always look
clean and fresh no matter where it was embedded.

Any ideas?





-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to