I am trying to answer question 1, I use prototype.js's viewport features: So add this to the head:
<script src="http://www.google.com/jsapi?key=YOUR_SITE_KEY"></script> Then this to the top of your file (no longer need the maps.google script tag), google.load("prototype", "1.6.1.0"); google.load("maps", "3", {"other_params":"sensor=false"}); Then add this to your initilization() function setSizeMap(){ var width = Math.floor(document.viewport.getDimensions().width * . 75); //set the float to percent of screen wanted var height = Math.floor(document.viewport.getDimensions().height * .85); //The same if(width > height){ //I want a map that's wider than it is tall. $('map_canvas').setStyle({ width: width + "px", height: height + "px", }); }else{ $('map_canvas').setStyle({ width: width + "px", height: width + "px", }); } zoomPercent = Math.floor((width*height)/(750*550)); //I am setting the zoom based on what looks good to me at 750w and 550h } Best, On Jun 22, 11:31 am, mmdolbow <[email protected]> wrote: > Hello all: > I'm migrating a mashup to API v3 and looking for some general tips. > Below is the production version in > v2:http://gis.mda.state.mn.us/maps/csgsoil.htm > Obviously not the prettiest HTML or Javascript, but it works. (I'm > citing it here because that's where the v3 version will go when it's > done, whereas the link I cite below is for testing.) > > I figured I might as well clean up and try to enhance a few things > when migrating to v3. I took out all the gunky wrappers and posted > this as my sample for you all to rip > apart:http://gis.mda.state.mn.us/maps/csgsoil_v3.htm > > So, I have 3 questions: > 1) How would you size the map div to adjust for screen resolution? I > used a miniscript to change the height of the <td> tag that holds the > div, but I'm doubtful this is the best approach. > 2) Similarly, how would you size the image call that creates the soil > temp graph that fills up the infowindow? Here's my dilemma at various > screen resolutions: > - At 800x600, you get scrollbars in the infowindow. > - At 1024x768, the scrollbars go away but the numbers are pretty > small and hard to read > - At 1280x1024, the numbers are easier to read but the map should > probably be set at a closer zoom so there's not so much space around > the markers > 3) Lastly, since the image call can take a while, how would you insert > a temporary image like "Loading" into the infowindow while the call is > taking place? > > Thanks in advance for the help. I realize quite a bit of this is just > resolving quirks of HTML and screen resolution, but I figure this > group is pretty good at taking a crack at this. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
