Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using the ESRI Javascript API to write a mobile web application. I have used the PopupMobile widget for viewing/editing attributes. This widget creates a popup on the map when a feature(s) is clicked and then provides a button to access the attributes in a new page.

I would like to bypass the popup altogether and go directly to the attribute page. Is this possible?

UPDATE:

I created my own onClick handler instead of using the PopupMobile widget, but I'm getting some very interesting results in my attributes page.

Here is a screenshot of the AttributeInspector widget as it displays on the page I set up in my application:

enter image description here

As you can see, the various dijits that make up the AttributeInspector are not displaying properly on the page.

Here is the code I used to set up the AttributeInspector:

mapDeferred.addCallback(function(response) {
    map = response.map;

    currentItem = response.itemInfo;
    $("#webmapTitle").html(currentItem.item.title);

    resizeMap();

    var fl = currentItem.itemData.operationalLayers[3].layerObject

    var layerInfo = [{
        featureLayer : fl
    }];

    var attInspector = new AttributeInspector({
        layerInfos : layerInfo
    }, "attributeInspector");
    attInspector.startup();

    dojo.connect(map, "onClick", function(evt) {

        var toleranceInPixels = 10;
        var pnt = evt.mapPoint;

        var pixelWidth = map.extent.getWidth() / map.width;
        var toleranceInMapCoords = toleranceInPixels * pixelWidth;
        var ext = new esri.geometry.Extent(pnt.x - toleranceInMapCoords,
            pnt.y - toleranceInMapCoords,
            pnt.x + toleranceInMapCoords,
            pnt.y + toleranceInMapCoords,
            map.spatialReference);

        var q = new esri.tasks.Query();
        q.geometry = ext;

        fl.selectFeatures(q)

        $.mobile.changePage($("#attributePage"));



    })
});

And here is the markup:

<!--Attribute Page-->
<div id="attributePage" data-role="page">
    <div data-role="header">
        <h1><span>Attributes</span></h1>
        <a href="#mapPage" id="mapPageBtn5" data-rel="page" data-theme='b'
        class="ui-btn-right">Map</a>
    </div>
    <div data-role="content">
        <div id="attributeInspector"></div>
    </div>
</div>
share|improve this question
1  
How are you going to tell the attribute page what record to edit? That is going to be the first part you need to consider. You can create your own on-click method when you select a object to trigger the edit function versus the infowindow. –  D.E.Wright Mar 30 '13 at 3:34
    
@D.E.Wright - The user will still click on a feature as if they were opening the popup window, but instead of the popup opening on the map, it should go straight to the editing page. I tried to write my own onClick handler to do this, but the Attribute Inspector widget does not appear correctly in the new page. –  Brian Apr 1 '13 at 14:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.