javascript - Google Maps APIv3 very slow and large -
i'm creating website local business , have added google map page using api v3. i've been working on reducing page size , load time , have noticed google maps biggest , slowest thing on page. i'm still running locally , don't have anywhere host currently, related code below.
without maps (emulation hdpi screen):
- server requests: 14 - data transferred: 1.5mb - load time: 1.19s
with maps (emulation hdpi screen):
- server requests: 82 - data transferred: 2.6mb - load time: 8.08s
i using google maps api v3 create map.
<div id="map-canvas"></div>
with script:
function initialize() { var mylatlng = new google.maps.latlng(-43.537061, 172.632426); var mapoptions = { center: mylatlng, zoom: 15 }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var marker = new google.maps.marker({ position: mylatlng, map: map, title: 'auto city services' }); } function loadscript() { var script = document.createelement('script'); script.type = 'text/javascript'; script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' + '&signed_in=true&callback=initialize'; document.body.appendchild(script); } window.onload = loadscript;
is there doing wrong or better in order increase speed of process? make load time , size faster. think i've got set asynchronous rest of page display , user won't wait 10s page show, it's still pretty terrible.
thanks!
Comments
Post a Comment