javascript - Markers Appearing at Random Times -
i trying create map 3 different markers, each appearing @ random time. think problem asynchricity.
the test url here , map shows towards bottom of page: http://www.comehike.com/hikes/hike_carpool.php?hike_id=125
does know doing wrong?
thanks, alex
you mean see markers drawing @ different time, e.g. @ beginning see red one, yellow, , blue one. next time load page notice blue marker showing first, yellow , red one. question right? if yes, not care :) depends on network connection, server loading etc. e.g. @ net tab of firebug, first time got:
so browser started requesting smile.gif , car.jpg @ same time, after while marker_sprite requested. see maps.google.com served request faster (though request started later). server (comehike.com) processed request car.jpg (though big one, 1.3kb), , comes smile.gif (though size 174b , first requested image).
next time pressed f5 , got images browser cache, browser sends requests see if not changed:
notice, browser started requesting information car.jpg quite early, due connection time, , waiting result took lot (though cached, browsers waits confirmation). again maps.google.com processed request faster comehike.com.
so not ajax, depends on when browser request image, , how fast server process (and depends on queue etc...).
if want markers shown @ same time, need use css sprites , combine marker images one. have there (any article good):
- css sprites: are, why they’re cool, , how use them
- css sprites: image slicing’s kiss of death
- the mystery of css sprites: techniques, tools , tutorials
this way have 1 image instead of three, when loaded browser display markers (at least won't notice there delay between marker drawing). hope explains , helps.
Comments
Post a Comment