Zoom is smoother on maps.google.com than on Google Maps API v3 -
i have noticed zoom on maps.google.com behaves differently (read: smoother) custom map using version 3 of google maps api. later found out applies demo google here.
is there way same smooth zoom feeling on maps using google maps api v3?
i've been trying search around net solution, can find people asking how zoom animations, not i'm looking for.
the native google maps site maps.google.com uses html5 canvas element rendering maps. google maps api v3 not. (as of late 2015) not possible smooth continuous zoom behavior using google maps api.
after searching google docs , web answers without results, took time understand how api v3 , how maps.google.com work render , display maps. there's 1 major difference makes clear why continuous zoom won't work using api:
google maps api v3 creates map made of image tiles each rendered single
<div />
containers fixed default size of256 x 256 px
. when switching zoom level every single tile has re-rendered new image (of whatever type, possibly dynamically styled custom overlays , on). expensive task, every additional zoom step adds resources loaded , computation costs re-rendering whole scene via dom manipulation. fluid zoom experience impossible, modern browsers on high cpu/memory machines.maps.google.com uses html5 canvas object rendering map scenes (i'm pretty sure there's api v3 style fallback variant old browsers). drawing in natively supported canvas object way less expensive replacing images in dom elements. google uses vector graphics based approach allows continuous zoom detail without need fetch additional resources. additionally needed information specific zoom level though fetched smaller chunks of data , applied drawing routines.
i must admit don't know how works in detail. it's discovered inspecting source , hope pretty sums why "smooth zoom" currently not possible using maps api. anyway, let's forward google maps api v4!
Comments
Post a Comment