1

http://www.youtube.com/watch?v=qxVO0tFdiuA&feature

i captured video. You can watch. Now i explain my problem.

Firstly, when i create popup and in popup menu when i call function and select feature,it's working, second time open popup menu, it is again work.

Problem is that when i change page and and show listview and call function,it is working but second time change page and call function and select again feature, first selection is kepping not deleted.

my codes :

mappage

<div data-role="page" id="mappage" >

    <div data-role="header"  class="fixedheader"  data-theme="e">
     <a href="#page" style="float:left;margin-top:4px;"  data-role="button"  data-iconpos="left " data-icon="back">Geri</a>


        <div class="ui-btn-right" style="margin-top:4px;">

          <a href="#adresbulalim" id="adresBul"   data-transition="none" data-rel="popup" data-icon="search" class="headerButton" data-role="button">Adres Ara</a>


                <div data-role="popup" id="adresbulalim" data-theme="d">
                             <div id="baslik" ></div>
                        <div class="scroll_adres" data-iscroll>

                        <ul data-role="listview" data-inset="true"  data-theme="d" id="doldur" style="min-width:300px; min-height:300px; "></ul>
                        </div>
                </div>  
         </div>
    </div>
          <div data-role="content"  >
          <p style="padding-top:20px"></p>
            <div id="map">

              <div id="navigation" data-role="controlgroup" data-type="vertical">
                 <a id="mapextends" onclick="mapextends();" data-role="button" > <img  style="width:24px;height:24px;" src="images/map.png"/></a>   
            <a href="#" data-role="button"  data-icon="plus" id="plus"
               data-iconpos="notext"></a>

            <a href="#" data-role="button" data-icon="minus" id="minus"
               data-iconpos="notext"></a>
          </div></div>
          </div>
        </div>

search

    <div data-role="page" id="search">

        <div data-role="header"  class="fixedheader"  data-theme="e">
     <a href="#mappage" style="float:left;margin-top:4px;" id="geri_butonu"  data-role="button"  data-iconpos="left " data-icon="back">Geri</a>
      <h1><div id="mobile_search_baslik"></div></h1>


      <div class="ui-btn-right">
       <a href="#" id="kapatbutonu" onclick="kapatMobile();" style="float:left;margin-top:4px;"  data-role="button"  data-iconpos="left " data-icon="back">Kapat</a>
      </div>
        </div>



     <p style="padding-top:20px"></p>
    <div data-role="content"  >
        <div id="mobile_search_scroll_wrap">

    <div id="mobile_search_scroll">
    <div class="mobile_scroll_adres" data-iscroll>
      <ul data-role="listview" id="mobile_search"></ul> 
         </div></div>
</div>      

if open browser on mobile phone

//if(device.mobile()==true){
        if (1 == 1){

            $("#adresBul").attr("href", "#search");
            mobile = 1;


        }

when search page open run;

$(document).delegate("#adresBul", "click", function () {


                    select.removeAllFeatures();

                    $.mobile.showPageLoadingMsg();

                    function handler(request) {

                        var geojson_format = new OpenLayers.Format.GeoJSON({});
                        featuresilce = geojson_format.read(request.responseText);

                        if (mobile == 0) {


                            $('#doldur').empty();
                            $('#baslik').empty();
                            $("#baslik").append(' <li>  <label  style="float:left;width:60%" id="baslikadres">İlçe</label></li>');

                            for (var f = 0; f < featuresilce.length; f++) {
                                $("#doldur").append("<li> <label onclick='getMahalle(" + featuresilce[f].attributes.ID + ",&quot;" + featuresilce[f].attributes.ADI + "&quot;," + featuresilce[f].attributes.GIS_ID + ");' style='float:left;width:80%'>" + featuresilce[f].attributes.ADI + "</label><div  onclick='findilce(" + f + ");' style='float:right;width='20%''><img  src='img/map.png'   style='float:right;'/></div></li>");
                            }
                            $.mobile.hidePageLoadingMsg();
                            $(".scroll_adres").iscrollview("refresh");
                        } else if (mobile == 1) {

                            $.mobile.changePage('#search');
                            $('#mobile_search').empty();
                            $('#mobile_search_baslik').empty();
                            $("#mobile_search_baslik").append('<label >İlçe</label>');

                            for (var f = 0; f < featuresilce.length; f++) {
                                $("#mobile_search").append("<li> <label  onclick='getMahalleMobile(" + featuresilce[f].attributes.ID + ",&quot;" + featuresilce[f].attributes.ADI + "&quot;," + featuresilce[f].attributes.GIS_ID + ");' style='float:left;width:80%'>" + featuresilce[f].attributes.ADI + "</label><div  onclick='findilce("+f+ ");' style='float:right;width='20%''><img  src='img/map.png'   style='float:right;'/></div></li>");
                            }
                            $.mobile.hidePageLoadingMsg();
                            $(".mobile_scroll_adres").iscrollview("refresh");
                        }
                    }

                    var request = OpenLayers.Request.GET({
                        url: rootURL + "ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Kaski:ADRES_ILCEALANI&maxFeatures=50&outputFormat=json&sortBy=ADI",

                        callback: handler

                    });

                });

problem function

 function findilce(f) {
                 select.destroyFeatures();
                 select.addFeatures(featuresilce[f]);
                 var dataExtent = select.getDataExtent();
                 map.zoomToExtent(dataExtent);
                 $.mobile.changePage('#mappage');
             }

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.