AnsweredAssumed Answered

Search for Point works and zooms to extent but----

Question asked by david477 on Jan 29, 2013
Latest reply on Apr 10, 2013 by cgnadinger
I have created a basemap service in arcgis server 10 this has master map and a point layer in. when i open the page the map displays correctly and i am able to seach for a point the map zooms to the point and displays the point however the master map does not draw i have to move the map with the mouse to get the master map to display it is in the correct position so i know my search is working and zooming.  I have been over my javascript code below i am now begining to think this is a arcgis server issue any ideas?


______CODE_______________________________________________________________________________________
var map;
        var findTask, findParams;

        function init()
        {
            map = new esri.Map("map");
            var basemap = new esri.layers.ArcGISDynamicMapServiceLayer("http://myserver/ArcGIS/rest/services/BaseMap/MapServer");
            map.addLayer(basemap);
  
           //Create Find Task using Post code layer
            findTask = new esri.tasks.FindTask("http://myserver/ArcGIS/rest/services/BaseMap/MapServer/");
            //Create the find parameters
            findParams = new esri.tasks.FindParameters();
            findParams.returnGeometry = true;
            findParams.layerIds = [0];
            findParams.searchFields = ["UPRN"];
            findParams.outSpatialReference = map.spatialReference;
        }

        function doFind()
        {
           //Set the search text to the value in the box
            findParams.searchText = dojo.byId("UPRN").value;
            findTask.execute(findParams, showResults);
        }

        function showResults(results)
        {
      
           map.graphics.clear();
           var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND, 10,
                                     new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
                                     new dojo.Color([0, 0, 0]), 1),
                                     new dojo.Color([255, 255, 0, 1]));

            //Create items array
            var items = [];
            for (var i = 0, il = results.length; i < il; i++) {
                items.push(results[i].feature.attributes);  //append each attribute list as item in store
                var graphic = results[i].feature;
                graphic.setSymbol(symbol);
                map.graphics.add(graphic);
            }


            for (var i = 0, il = map.graphics.graphics.length; i < il; i++) {
                var currentGraphic = map.graphics.graphics[i];

            }
           
            var PointExtent = new esri.geometry.Extent();
            PointExtent.xmin = currentGraphic.geometry.x - 250.00;
            PointExtent.ymin = currentGraphic.geometry.y - 250.00;
            PointExtent.xmax = currentGraphic.geometry.x + 250.00;
            PointExtent.ymax = currentGraphic.geometry.y + 250.00;
            map.setExtent(PointExtent);

        }
___________CODE_______________________________________________________________________________________

Outcomes