var mapFrameWidth = map._getFrameWidth(); dojo.forEach(featurePts, function (pt, idx) { var featureScreenPt = map.toScreen(pt, true); if (mapFrameWidth !== -1) { featureScreenPt.x = featureScreenPt.x % mapFrameWidth; if (featureScreenPt.x < 0) { featureScreenPt.x += mapFrameWidth; } if (map.width > mapFrameWidth) { var margin = (map.width - mapFrameWidth)/2; while (featureScreenPt.x < margin) { featureScreenPt.x += mapFrameWidth; } } } }
Rex,When you say "tracking code", what you are trying to achieve? A better understanding use case would allow us to help you more.To answer your question. In order to get the frame width of a map in current zoom level, you can call map._getFrameWidth();
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.