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();
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.