Introduction In this article I will explain how to send gridview row values to other page and after update that record values return back to the gridview page using.Asp Update Textbox Without Post Back Updatepanel Not Refreshing' title='Asp Update Textbox Without Post Back Updatepanel Not Refreshing' />Google Maps Control for ASP.Net. Details. Category ASP.Net. Published on Tuesday, 2.January 2. 01. 7 1.Written by Shabdar.Hits 2. 58. 61. 1 Free Open source Control.Version 1. 9. 3 Jan 2.Asp Update Textbox Without Post Back Updatepanel ProgressFollowing changes are done in this version.Fixed missing API Key issue.Google Map do not seem to allow rendering map without API key now.Asp Update Textbox Without Post Back Updatepanel UpdateprogressYou need to get your own Google Map API key and enter it in web.Google. APIKey valueEnter Your API Key Here.Version 1. 9. 2 Feb 1.Following changes are done in this version.Fixed several issues with DirectionsExample Map.With. Directions.Now it works properly with Page postback.Change of direction color is possible now.Fixed Map. Type issue.Now you can change map type road map, satellite, hybrid via ASP.Net code. Example Map.With. Satellite. View.Fixed issue with Icon.Image. Width and Icon.Image. Height properties.Version 1. 9. 1 December 2.Following changes are done in this version.Fixed Info. Window position.In version 1. 9 marker Info.Window was appearing on top of marker instead of above marker.Fixed geocoding Example Map.With. Geocoding. aspx.API Key is no longer required for geocoding.But google accepts only 2,5.Added reverse geocoding capability Example Map.With. Reverse. Geocoding.Introduction. Most of us are familiar with google map.Google has provided a very reach APIs to use it in our own application.But we need some short of javascript knowledge in order to use it.I dont know about others, but for me it was a little difficult to use javascript along with google apis in ASP.Net pages, specifically if you want to use server side functions to draw google map dynamically.For example, in my case I wanted to pull latitude longitude information from a SQL Server database and then use them to insert pushpins on google map.If you are familiar with Ajax framework, you know the answer.You will have to call asp.How simple is that Atleast not for me.So I have decided to write a user control which can take care of javascript part and allows me to concentrate on serverside functions.Features Enables you to draw google map.No javascript knowledge required.Just drag and drop control on your page.Ajax calls to retrieve server side data.Enables you to change pushpin postions on the fly.No need to refresh full map.Enables you to change pushpin icons, positions from asp.Pushpin click and drag event support in asp.Map click event support in asp.Directions support.Allows you to draw route between multiple addresses Polylines and Polygons support.Geocoding support i.Find latitude longitude from specified address and create pushpin on that location.When pushpins are changing positions, automatic boundary reset and zoom support to display all pushpins.Optimized to give you best performance.How to use. In this part of article, I dont want you to explain how I created this control.Instead I want you to start using it.To view documentation for source code visit following article.Google Maps Control for ASP.Net Part 2. Requirements.Visual Studio 2. 00.Microsot ASP. Net Ajax framework.You can download it from here.Internet Explorer 7.Mozilla Firefox 2.Note It may work on other browsers.I have tested on IE and Firefox only.Follow below steps in order to use it in your ASP.Net website. Download source from link provided on top of the page.Extract it somewhere on your harddrive.Open extracted folder as a website in Visual Studio and run it.When you run this website, you will be able to navigate few samples pages.To use this control in your application, copy following files to your ASP.Net application in same structure as shown below.Adding Google Map control to your webpage.Open page where you want to insert Google Map.Drag Google. Map.For. ASPNet. ascx control to your page.You wont be able to see Google Map in design view.Instead, you should see Script Manager as part of this control.At this point you can run your application and you should be able to see a blank Google Map on your page as shown below.Lets add few pushpins on this map.For that you will have to add some code in PageLoad event of your page.Passing parameters to Google Map control.You must specify Google Map API Key for this component.You can obtain this key from http code.Is. Post. Back. Google.Map. For. ASPNet.Google. Map. Object.APIKey. Note that inialization code for map should go inside if Is.Post. Back block.Optionally you can specify which version of Google maps API to use.You can get more information about Google Maps API version here.Google. Map. For.ASPNet. 1. Google.Map. Object. APIVersion 2.Specify width and height for map.You can specify either in pixels or in percentage relative to its container.Google. Map. For.ASPNet. 1. Google.Map. Object. Width 8.Google. Map. For.ASPNet. 1. Google.Map. Object. Height 6.Specify zoom level.Default is 3. Google.Map. For. ASPNet.Google. Map. Object.Zoom. Level 1. 4.Specify Center Point for map.Map will be centered on this point.Google. Map. For.ASPNet. 1. Google.Map. Object. Center.Point. new Google.PointCenter. Point, 4.Add pushpins for map.This can be done by initializing Google.Point type object.In constructor of Google.Point, First argument is ID of this pushpin.It must be unique for each pin.Second and third arguments are latitude and longitude.Google. Map. For.ASPNet. 1. Google.Map. Object. Points.Add. new Google. Point1, 4.Alternatively you can also do it like below.Google. Point GP new Google.Point. GP. Latitude 4.GP. Longitude 7. Google.Map. For. ASPNet.Google. Map. Object.Points. AddGP. You can add as many pushpins as you wish.Now run website again and you should see pushpins on map.Assigning custom icon to pushpins.Up to this point, I have explained you basics of using Google Map control.Now lets implement some advanced functionality.Lets say we want to move pushpins when user do some action.For example when a user clicks on a button.For that, follow below steps.Creating Interactive Map.You can create interactive map using Google Map control.You can move pushpins when user clicks on a button.Here is how you can do it.Insert standard asp.Write following code in click event of this button.Button. 1Clickobject sender, Event.Args e. Google. Map.For. ASPNet. 1. Google.Map. Object. Points1.Latitude 0. 0. Google.Map. For. ASPNet. Descargar Crack No Cd Black And White 13 on this page. Google. Map. Object.Points1. Longitude 0.We are incrementing Latitude and Longitude value for Pushpin 1 here.Note that I am using IDIn above code 1 of pushpin to set new Latitude and Longitude.Run your application and click on Button.You will note that whole page gets refreshed or postback.To stop it from posting back, you need to wrap this button with an Ajax Update panel.Go to Visual Studio toolbox and drag Ajax Updatepanel control on your page.Move your button inside this update panel.Now run website again and click on button.You should notice that now page is not posting back and Pushpin moves on map.Auto refreshing map and GPS Navigation.You can use Ajax Framewors timer control in similar way as button control I have explained above.On TimerTick event you can specify new latitude longitude for all pushpins.This way Map will move all pushpins automatically after specified time delay.You can hook up any GPS service with this control to create GPS Navigation system.Creating Polylines with Google Map control.Create points for polyline,Define Points for polygon.Google. Point GP1 new Google.Point. GP1. ID GP1.GP1. Latitude 4. GP1.Longitude 7. Google.Point GP2 new Google.Point. GP2. ID GP2.GP2. Latitude 4. GP2.Longitude 7. Define GP3,GP4,GP5,GP6 and GP7 in similar way.Google. Point GP7 new Google.Point. GP7. ID GP7.GP7. Latitude 4. GP7.Longitude 7. Create polyline between points GP1, GP2 and GP3Create Polygon using above points.Google. Polygon PG1 new Google.Polygon. PG1. ID PG1.Give Hex code for line color.PG1. Fill. Color 0.FF. PG1. Fill. Opacity 0.Stroke is outer border of polygon.PG1. Stroke. Color 0.FF. PG1. Stroke. Opacity 1.PG1. Stroke. Weight 2.Add points to polygon.PG1. Points. AddGP1.PG1. Points. AddGP2.PG1. Points. AddGP3.PG1. Points. AddGP4.PG1. Points. AddGP5.PG1. Points. AddGP6.PG1. Points. AddGP7.Add Polyline to Google Map control,Google.Map. For. ASPNet.Google. Map. Object.Polygons. AddPG1.Traffic Overlays Go through samples provided in download.MSDN Magazine Issues.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |