The recommended solution to change body > * to body .page is no good
for me. Makes the whole app behave very poorly on map pan/zoom.
I've been debugging this with Safari and Firebug, and I'm inspecting
the css properties for the div that contains the marker when I toggle
between body > * (where the icon won't show up) and body .page (where
the icon does show up)
body > *
height: 0px;
left: 334px;
top: 210px;
width: 0px;
body .page
height: 37px;
left: 318px;
top: 173px;
width: 32px;
Obviously if height and width are zero, the icon won't show, so I
wrote a quick/dirty jquery to fix this.
function fixCarIcon() {
$("div[style*='car.png']").css('width', '32px').css('height',
'37px');
}
This is very specific to my code, but you get the idea. The height
and width of the png are static, so I know I can always set them.
I call this after I add a marker to the map, and it works, kind of.
The problem is that the left and top values are still off. The lat/
lng position of the icon is set the same...like so:
function addCurrentLocation(latlng) {
marker = new google.maps.Marker( {
position : latlng,
map : map
});
}
I know the height and width are always the same, but the top/left are
going to be dependent on the lat/lng, so I'm not sure why these values
are calculated differently.
I know the Map object has a function to get the x/y coordinates from a
lat/lng, so I guess I'll try that next...perhaps I can use that to set
the top/left, but honestly, this whole thing is one giant hack, and I
wish there was a better way.
Any ideas?
Regards,
Davis
http://mobiweb.pbworks.com/Google-Maps-and-jQTouch
I realized after I wrote that that I didn't take into account rotation
of the device. I've fixed that locally but never updated those
directions. If you need that code too let me know. Not sure how much
has changed honestly.
> --
> To unsubscribe, reply using "remove me" as the subject.
>
--
Proud supporter of DC United
I'm giving up on the combo of maps v3 + jqtouch, and going back to maps v2.
Implementing the switch back now...hopefully it fixes many of the
issues I've had with trying to get these two to play together nicely.
Your examples are helpful.
Best regards,
Davis
--
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977