Hi Friends,
i m doing web application on google geo location depends on the drop down
in aspx page:
------------
<script type="text/javascript">
var markers = [
<asp:Repeater ID="rptMarkers" runat="server">
<ItemTemplate>
{
"title": '<%# Eval("pincode") %>',
"lat": '<%# Eval("Latitude") %>',
"lng": '<%# Eval("Longitude") %>',
"description": '<%# Eval("descp") %>'
}
</ItemTemplate>
<SeparatorTemplate>
,
</SeparatorTemplate>
</asp:Repeater>
];
</script>
in above pincode,lat,long,descp are fetching from my procedure....
alter procedure LAT_TEST_DYNAM0
@dist_id int
as
begin
create table #temp (pincode varchar(10),latitude numeric(18,10),longitude numeric(18,10),descp varchar(5000))
insert into #temp (pincode,latitude,longitude)
select distinct a.pincode,b.latitude,b.longitude from
ind_cust_det a (nolock) inner join ind_geo_loc b on a.pincode=b.pincode
where
b.ind_dist_id=@dist_id
declare @pin int
declare cur cursor dynamic for select distinct pincode from #temp
declare @sales numeric (18,2)
declare @total numeric (18,2)
declare @des varchar(5000)
declare @cust_id int
open cur
fetch first from cur into @pin
while @@fetch_status=0
begin
set @des=''
set @total=0
set @des='<table border="1"><tr><th>Customer</th><th>Sales</th></tr>'
declare cur1 cursor dynamic for select cust_id,sum(sales) sales from ind_cust_det (nolock) where pincode=@pin group by cust_id
open cur1
fetch first from cur1 into @cust_id,@sales
while @@fetch_status=0
begin
set @des=@des+ '<tr><td align="center">' + convert(varchar,@cust_id) + '</td><td align="center">' + convert(varchar,@sales) +'</td></tr>'
set @total=@total+@sales
fetch next from cur1 into @cust_id,@sales
end
set @des=@des+ '<tr><td align="center">TOTAL</td><td>' + convert(varchar,@total)+ '</td></tr></table>'
close cur1
deallocate cur1
update #temp set descp=@des where pincode=@pin
fetch next from cur into @pin
end
close cur
deallocate cur
select * from #temp
drop table #temp
end
i had the cascading drop down ..... when i choose the state & dist only the marker ll fetch from that and displayed ....
if i m nothing choosed the marker is zero lat ,long its showing error ?
what was the solution if i m nothing choosed i wanna display only india map....
kindly help me friends!!!!!