On Feb 8, 8:35 pm, tommo77funk <[email protected]> wrote: > > here is a link to my map > > http://bit.ly/58aIwr
You have copied and pasted the function setShiftedCenter() but you're not using it. Anyway, you're using some external "plugin" to create the map which has lots of other functionalities, that are not relevant to your map. If you want to keep using that "plugin" you're going to have to figure out how to make the changes you want according to the rules of that plugin. -- Marcelo - http://maps.forum.nu -- > > here is a link to the .js file > > http://bit.ly/auiJHc > > thanks, > > tom > > On Feb 8, 7:04 pm, Marcelo <[email protected]> wrote: > > > > > On Feb 8, 7:31 pm, tommo77funk <[email protected]> wrote: > > > > I am a busy photographer not a coder, > > > 1. I am busy too. We are all volunteers answering questions here, and > > we have jobs as well. > > 2. This group is for programmers. If you're not a programmer, but > > still choose to do a programmers job then be prepared to invest > > time:http://www.catb.org/~esr/faqs/smart-questions.html#id382403http://www... > > > > I did try your code thanks, but that also broke the timer, hence is > > > the reason I posted code. > > > Take it one step at a time. Show us the page in which the timer > > brakes. (with a link, not a code dump). > > > -- > > Marcelo -http://maps.forum.nu > > -- > > > > I will keep trying and learning - many thanks for advice, appreciate > > > it. > > > > tom > > > > On Feb 8, 6:02 pm, Marcelo <[email protected]> wrote: > > > > > On Feb 8, 6:43 pm, tommo77funk <[email protected]> wrote: > > > > > > I have looked at the documentation, but am scratching my head on how > > > > > to write the code, so would really appreciate if someone could give me > > > > > a code hint, to writing this solution. > > > > > Nobody is going to write your code for you, although I almost did. > > > > Did you look at the link I posted? > > > > > And please, don't post code dumps here. > > > > > -- > > > > Marcelo -http://maps.forum.nu > > > > -- > > > > > > I understand what Martin is advising but just dont how to write it, > > > > > into what I've already got, > > > > > > fromLatLngToPixel(latlng:GLatLng, zoom:Number) > > > > > > getPoint() > > > > > > GPoint(x:0, y:100) > > > > > > fromPixelToLatLng(pixel:GPoint, zoom:Number, unbounded?:Boolean) > > > > > > As mentioned I will be well chuffed and grateful to sort this > > > > > problem, > > > > > > Many many thanks ! > > > > > > tom > > > > > > here is my complete code > > > > > > function customizeMap( properties, map ) { > > > > > map.addMapType(G_SATELLITE_3D_MAP); > > > > > map.enableScrollWheelZoom(); > > > > > > var counter=0, > > > > > cancel=false, > > > > > infowindow = map.getInfoWindow(), > > > > > > loopMap = function() { > > > > > if (++counter >= > > > > > properties.post_data.posts.length) counter = 0; > > > > > > GeoMashup.clickMarker( properties.post_data.posts[counter].post_id ); > > > > > if ( ! cancel ) { > > > > > setTimeout(function() { loopMap(); }, > > > > > 10000) > > > > > } > > > > > }; > > > > > > // If we don't have a request to open a post, start the tour > > > > > if ( ! properties.open_post_id ) { > > > > > setTimeout(function() { loopMap(); },10000) > > > > > } > > > > > // Center info windows when opened > > > > > google.maps.Event.addListener( map, 'infowindowopen', > > > > > function() { > > > > > map.panTo( infowindow.getPoint() ); > > > > > } ); > > > > > > // Cancel the tour if the info window is manually closed > > > > > google.maps.Event.addListener( infowindow, 'closeclick', > > > > > function() { > > > > > cancel = true; > > > > > } ); > > > > > loopMap(); > > > > > > } > > > > > > On Feb 8, 4:44 pm, Martin <[email protected]> wrote: > > > > > > > The GInfoWindow getPoint() method returns a GLatLng > > > > > > object:http://code.google.com/apis/maps/documentation/reference.html#GInfoWi... > > > > > > > Each map type has a GProjection interface which has a > > > > > > fromLatLngToPixel() method, this method returns a GPoint: > > > > > > >http://code.google.com/apis/maps/documentation/reference.html#GProjec... > > > > > > >http://code.google.com/apis/maps/documentation/reference.html#GPoint > > > > > > > So you could get the infowindow anchor point as a GLatLng and > > > > > > convert > > > > > > it to a GPoint (pixels) object. > > > > > > > Take that GPoint and create a new GPoint which represents a pixel > > > > > > offset for the height of your infowindow. > > > > > > > Now pass new GPoint back to the GProjection fromPixelToLatLng() > > > > > > method > > > > > > - this method returns a GLatLng object which you should(!) be able > > > > > > to > > > > > > use to center the > > > > > > map.http://code.google.com/apis/maps/documentation/reference.html#GProjec... > > > > > > > Martin. > > > > > > > On 8 Feb, 15:30, tommo77funk <[email protected]> wrote: > > > > > > > > Hi, > > > > > > > > I'd be really grateful for any advice, I have the > > > > > > > following > > > > > > > function in my map, that animates to a marker and opens and > > > > > > > infowindow > > > > > > > > google.maps.Event.addListener( map, 'infowindowopen', > > > > > > > function() { > > > > > > > map.panTo( infowindow.getPoint() ); > > > > > > > } ); > > > > > > > > the problem is the height of my infowindow means that the top > > > > > > > gets cut > > > > > > > off from view, when centering on the map, this is also due to my > > > > > > > map > > > > > > > height, which I dont want to change, as it has to fit into space > > > > > > > on my > > > > > > > webpage. > > > > > > > > I have seen references to vertical offset for infowindow to > > > > > > > marker - > > > > > > > but is it possible to have an offset for for where the map center > > > > > > > is ? > > > > > > > > I have seen this also > > > > > > > >http://code.google.com/apis/maps/documentation/reference.html#GPoint > > > > > > > > and tried > > > > > > > > google.maps.Event.addListener( map, 'infowindowopen', > > > > > > > function() { > > > > > > > map.panTo( infowindow.getPoint(0,100) ); > > > > > > > } ); > > > > > > > > but it does not seem to work... > > > > > > > > You can see example of my project herehttp://bit.ly/58aIwr > > > > > > > > As mentioned any advice would be greatly appreciated. > > > > > > > > Best wishes, > > > > > > > > tom -- 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.
