On Apr 29, 12:16 am, marcelo <[email protected]> wrote: > On Apr 29, 8:19 am, René <[email protected]> wrote: > > > Definitely helps a bit, but "nePixel.x+210" seems to be interpreted > > not as pixels... With a value of 2, the extensions is about 200%. > > I'm not sure I uderstand what you're saying without a link to apage > that demonstrates the problem, but keep in mind that zoon levels are > discrete values, so if the addition of 1 pixel width to the marker's > bounds means that it no longer fits the maps bounds, then the > calculated zoom level will be one level lower, and that may look as if > your marker's bounds have been extended by 200%.
This is actually a key point. I tried various ways to compensate for the width of an overlayed (overlain?) sidebar, including something like Marcelo's suggestion above. Repeatedly, the effective outcome was that the map zoomed out one level, and that accounted for most of the benefit from the change. The benefit from shifting the center point of the marker bounds was not as important, given that in most cases the map would zoom out to keep all markers showing after the center had moved. I really like the 100% map, but it requires a little extra work to keep overlays useful but not obtrusive So I ended up with an "Adjust Fit" button that sets bounds for all current markers, finds the resulting zoomlevel, and recenters the map with that zoomlevel minus one (1), keeping the original center point. (That button also serves when the user has added markers; click "Adjust Fit" to get them all into view.) Also I settled on a few ways to make the sidebar overlay more friendly: - give the user a button to hide/show the sidebar; - reduce the sidebar's background opacity slightly, so the user may notice a marker underneath the sidebar; - set the width of the sidebar in 'em' measures, so it will be narrower if the user reduces type size in their browser; The sidebar also resizes and gets a scrollbar if the browser window height is reduced, but that's not what you asked about. Here's a link to a new site -- very much a work in progress -- that has a set of overlays under programmable control. Click the Show List button in the upper right to see the sidebar. Sorry to say this map may not be a good one to learn from; much of the heavy lifting is done by a mapper object based on a separate javascript library, Cartografo.js; the data for the saved locations is obtained in an xhr call that isn't obvious; and this site will be evolving rapidly as we add mapping projects to the folio. Some days it will be non- functional. But feel free to check it out and try things. (If you save places on this map they'll be cleaned out periodically.) I mainly mention it here to provide a viewable example of a sidebar on a 100% map. I suppose it technically isn't a *sidebar* anymore, is it? <http://www.mapfolio.org/locations> HTH --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" 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-API?hl=en -~----------~----~----~----~------~----~------~--~---
