sailitang

Javascript debug problem

Discussion created by sailitang on Sep 18, 2013
Latest reply on Sep 19, 2013 by JUihlein-esristaff
Hi,

I am using ArcGIS api for javascript. I have a javascript function

<script type="text/javascript" src="http://js.arcgis.com/3.6/"></script>
                   <script type="text/javascript">

                       function DisplayMap(strPoints, strfirestat) {

                           var map;
                           var i;
                           //var regions;

                           require([
                                   
                                    "esri/map", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "esri/graphic", "esri/tasks/GeometryService", "esri/graphicsUtils", "dojo/domReady!"
                            ], function (
                                          
                                    Map, Point, SimpleMarkerSymbol, Graphic, GeometryService, graphicsUtils

){
                            });
                       }
</script>

My vb.net code is:
jvscript = "DisplayMap('" & str & "', '" & firestr & "');"
Page.ClientScript.RegisterStartupScript(Me.GetType, "TimeOutMessage", jvscript, True)

Once I add "esri/graphicsUtils" and graphicsUtils, I always get the error message:"JavaScript runtime error: 'DisplayMap' is undefined". But if I delete them, the code works. Do you have any idea about it? I need graphicsUtils to get selected polygon???s center: var center = graphicsUtils.graphicsExtent(selection).getCenter(); Could you tell me what the problem of my above code is? Thanks.

Saili

Outcomes