layer.setQuery is not a function CartoDB

المشرف العام

Administrator
طاقم الإدارة
I am getting this error:layer.setQuery is not a function



function parcelSearch(layer) { var sql = new cartodb.SQL({ user: 'username' }); var $options = $('#searchParcel'); $options.click(function(e) { var streetNam = document.getElementById('parcelid').value; if(streetNam === "") { alert("Please enter the parcel ID"); } else { query = "SELECT * FROM parcels_sa WHERE parcel_id ILIKE '%" + streetNam + "%'"; console.log(query); layer.getSubLayer(0).show(); sql.getBounds(query).done(function(bounds) { latlon = bounds[0]; // console.log(latlon); //alert(latlon); $('.latlongit').val(latlon); map.fitBounds(bounds); }); } // change the query in the layer to update the map layer.setQuery(query); }); var $clear = $('#clear'); $clear.click(function(e) { $('#parcelid').val(''); query = "SELECT * parcels_sa"; console.log(query); layer.getSubLayer(0).hide(); sql.getBounds(query).done(function(bounds) { latlon = bounds[0]; map.fitBounds(bounds); }); // change the query in the layer to update the basemap layer.setQuery(query); });}

أكثر...
 
أعلى