AnsweredAssumed Answered

Destroy and Recreate the Identify Event?

Question asked by cgnadinger on Mar 26, 2013
I'm not sure if I have something in the wrong location or if it's a quirk that I cannot sort out.

I am trying to work on a mobile site using some of the dojo options. Right now I have a basic template with the Identify built in (from It fires off on this line below:

<span><div id="idButton" data-dojo-type="" data-dojo-props='label:"Identify", onClick:function(toggle){mapReady();}'></div></span>

That works fine but if I select any of the dojo toolbar buttons or move off the page in anyway, when I return my click on the identify and the place it searches are completely off... always to the left. I am adding a couple of screenshots to this showing what it looks like. I clicked the same point in both cases... after I moved pages the click is off.


The full html code is below. The js code typically follow the link above, aside from pointing to my data instead of esri's.

If anyone has any guidance or suggestions I would greatly appreciate it. I have just started dabbling in javascript so I am not the most knowledgable of this language .. yet.

I was trying to see if there was a way to destroy the identify event any time you leave the map view ... then recreate it when you return and re-select the button, but so far I'm not having any luck. Is this possible or is there something else that will solve this?

Thanks in advance!

<!DOCTYPE html>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <!-- prevent cache - TEMPORARY -->
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="pragma" content="no-cache">
        <title>Because I Said So .. </title>
        <link rel="stylesheet" href="">
        <link rel="stylesheet" href="">
        <link rel="stylesheet" href="style/default.css">
        <script src=""></script>
        <script src=""> </script>
        <script src="" data-dojo-config="async:true"></script>
        <script type="text/javascript" src="js/default.js"></script>
        <script type="text/javascript" src="js/identify.js"></script>    
    <body onload="resizeMap();" onorientationchange="orientationChanged();">
        <!-- OVERALL HEADER -->
        <div data-dojo-type="" fixed="top">LWC Mobile Map Test
            <span data-dojo-type="" data-dojo-props='icon:"images/mainMenu.png", moveTo:"mainMenu"'></span>
        <!-- MAIN MENU -->
        <div id="mainMenu" data-dojo-type="" data-dojo-props="selected: true"> <!-- selected true makes this default screen -->
            <h2 data-dojo-type="">Menu</h2>
            <ul data-dojo-type="">
                <li data-dojo-type="" data-dojo-props="moveTo: 'search'">Search</li>
                <li data-dojo-type="" data-dojo-props="moveTo: 'mapView'">Map View</li>
                <li data-dojo-type="" data-dojo-props="moveTo: 'addLayers'">Add Layers</li>
        <!-- MAIN SEARCH MENU -->
        <div id="search" data-dojo-type="">
            <h2 data-dojo-type="">Search Menu</h2>
            <ul data-dojo-type="">
                <li data-dojo-type="" data-dojo-props="moveTo:'searchByLocation'">Search by Location</li>
                <li data-dojo-type="" data-dojo-props="moveTo:'searchByFeature'">Search by Feature</li>
        <!-- SEARCH BY LOCATION -->
        <div id="searchByLocation" data-dojo-type="">
            <h2 data-dojo-type="">Search by Location</h2>
            <ul data-dojo-type="">
                <li data-dojo-type="" data-dojo-props="moveTo:'search'"><i>Return to the Search Menu</i></li>
                <li data-dojo-type="" data-dojo-props="rightText:'AcmePhone'">A New Search</li>
                <li data-dojo-type="" data-dojo-props="rightText:'AcmePhone'">Some Type of Search</li>
        <!-- SEARCH BY FEATURE -->
        <div id="searchByFeature" data-dojo-type="">
            <h2 data-dojo-type="">Search by Feature</h2>
            <ul data-dojo-type="">
                <li data-dojo-type="" data-dojo-props="moveTo:'search'"><i>Return to the Search Menu</i></li>
                <li data-dojo-type="" data-dojo-props="rightText:'AcmePhone'">More Stuff</li>
                <li data-dojo-type="" data-dojo-props="rightText:'AcmePhone'">And Even More..</li>
        <!-- MAP VIEW -->
        <div id="mapView" data-dojo-type="" data-dojo-props="selected:'true'" style="width:100%; height:100%;">
            <div id="quickTools" data-dojo-type="" data-dojo-props="fixed: 'top'">Quick Tools
                <span><div id="idButton" data-dojo-type="" data-dojo-props='label:"Identify", onClick:function(toggle){mapReady();}'></div></span>
                <span data-dojo-type="" data-dojo-props="moveTo: 'addLayers'">Toggle Map Layers</span>
            <div id="map" style="width:100%; height:100%;">
        <div id="addLayers" data-dojo-type="">
            <h2 data-dojo-type="">Add Layers</h2>
            <ul data-dojo-type="">
                <li data-dojo-type="" data-dojo-props="moveTo: 'mapView'">Return to the Map View</li>
                <li data-dojo-type="">Satellite Imagery
                    <span id="layer1" data-dojo-type="" value="off"></span>
                <li data-dojo-type="">LWC Facility Information
                    <span id="layer2" data-dojo-type="" value="on"></span>