var map = new Map("mapDiv", { basemap: "streets", center: [-92.593, 38.5], zoom: 6, autoResize:false }); map.on("load", mapLoadHandler); function mapLoadHandler(evt){ registry.byId('mapView').on('AfterTransitionIn', resizeMap); } function resizeMap() { mobile.hideAddressBar(); adjustMapHeight(); map.resize(); map.reposition(); } function adjustMapHeight() { var headHeight = registry.byId('mapHeader').domNode.clientHeight; var availHeight = mobile.getScreenSize().h - headHeight - 60; if (has('iphone') || has('ipod')) { availHeight += iphoneAdjustment(); } dom.byId("mapDiv").style.height = availHeight + "px"; dom.byId("mapDiv").style.width = "100%"; } function iphoneAdjustment() { var sz = mobile.getScreenSize(); if (sz.h > sz.w) { //portrait //Need to add address bar height back to map because it has not been hidden yet 44 = height of bottom safari button bar return screen.availHeight - window.innerHeight - 44; } else { //landscape //Need to react to full screen / bottom button bar visible toggles var _conn = on(window, 'resize', function() { _conn.remove(); resizeMap(); }); return 0; } }
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.