c# - Is it possible to add Feature Service to IPageLayout and IMap? -
can load feature service or map service published in arc server ipagelayout
, imap
? i'm new arcgis. can't understand ipagelayout
, imap
. please me can.
public void addscalebar(ipagelayout pagelayout, imap map) { if (pagelayout == null || map == null) { return; } ienvelope envelope = new envelopeclass(); envelope.putcoords(0.2, 0.2, 1, 2); // specify location , size of scalebar iuid uid = new uidclass(); uid.value = "esricarto.alternatingscalebar"; // create surround. set geometry of mapsurroundframe give location // activate , add pagelayout's graphics container igraphicscontainer graphicscontainer = pagelayout igraphicscontainer; // dynamic cast iactiveview activeview = pagelayout iactiveview; // dynamic cast iframeelement frameelement = graphicscontainer.findframe(map); imapframe mapframe = frameelement imapframe; // dynamic cast imapsurroundframe mapsurroundframe = mapframe.createsurroundframe(uid esri.arcgis.esrisystem.uid, null); // dynamic cast ielement element = mapsurroundframe ielement; // dynamic cast element.geometry = envelope; element.activate(activeview.screendisplay); graphicscontainer.addelement(element, 0); imapsurround mapsurround = mapsurroundframe.mapsurround; iscalebar markerscalebar = ((iscalebar)(mapsurround)); markerscalebar.labelposition = esrivertposenum.esribelow; markerscalebar.usemapsettings(); }
Comments
Post a Comment