Google Maps Control for ASP. Net. Details. Category: ASP. Net. Published on Saturday, 1. April 2. 01. 1 1. Written by Shabdar. Hits: 2. 28. 83. 3 Free Open source Control. Version 1. 9. 2 (Feb 1. Following changes are done in this version. Presidential Election Predictions 2016 (an ASA competition) R with Power BI: Import, Transform, Visualize and Share; Five ways to calculate internal consistency; R Markdown: How to format tables and. Google Maps V3: Draw route line between two geographic locations / Coordinates / Latitude and Longitude points Here Mudassar Ahmed Khan has explained, how to draw route line between two geographic locations i.e. Hello Bjorn, thanks for the hints? Coz in my XML has 1700 stores. And it just crash if I try to search. Fixed several issues with Directions(Example: Map. With. Directions. Now it works properly with Page postback. Change of direction color is possible now. Now you can change map type (road map, satellite, hybrid) via ASP. Net code. In version 1. Info. Window was appearing on top of marker instead of above marker. 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. About a year ago, Robert Kosara at eagereyes.org published a fascinating set of visualizations demonstrating the overall structure of ZIP (and post) codes in various countries, for obvious reasons he called them ZipScribble. Use the links below to display groups of related layers. Hover over the link to display the primary layers displayed with each theme. Love the app however the new version doesnt have the Add to TomTom button anymore, and the route’s path doesnt show up any more. I use this app every day for work and am lost without being able to use that TomTom button. I don't 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. 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. 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. 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. 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 won't 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. For that you will have to add some code in 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. You can get more information about Google Maps API version here. You can specify either in pixels or in percentage relative to it's container. Map will be centered on this point. 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. 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 let's implement some advanced functionality. Let's 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. Note that I am using ID(In above code . You will note that whole page get's 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 Framewor's timer control in similar way as button control (I have explained above). 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 = . I have explained all sort of circumtances in which you may want to use google map control. If you have any questions, feel free to ask. In Part 2, I have explained souce code of Google Map user control and how to customize it for your own use. Google Maps Control for ASP. Net - Part 2. Special Notes I have published this article on www. Here is the link to this article. Google Maps Control for ASP. Net - Part 1. Version History. Version 1. 9 (April 1. Following changes are done in this version. Upgraded code to support Google Maps API v. Most of the code should work fine. It will allow user to get current zoom level in ASP. Net code. Added Map. With. Zoom. Levels. Version 1. 7 (March 2. Following changes are done in this version. This will disable recentering and automatic zoom by default. Many people were not able to do this before. See example Map. Click. Event. aspx. New event On. Pushpin. Click() added to control. See example Pushpins. Click. Event. aspx. New event On. Pushpin. Drag() added to control. See example Pushpins. Drag. Event. aspx. Removed Google. Object. Directions. From. Address and Google. Object. Directions. To. Address properties. Instead added Google. Object. Directions. Addresses property. This will allow users to draw direction from more than two addresses. See example Map. With. Directions. aspx. Changed name of Show. Direction property to Show. Direction. Instructions to be more clear. Added property as Google. Object. Directions. Hide. Markers. This property controls direction markers(pushpins) visibility. It will allow user to draw a route between multiple addresses with just a polyline (without default pushpins that are displayed when directions are drawn). See example Map. With. Directions. aspx. Polyline. Color. This property controls color of direction line. See example Map. With. Directions. aspx. Added property as Google. Object. Directions. Polyline. Width. This property controls width of direction line. See example Map. With. Directions. aspx. Added property as Google. Object. Directions. Polyline. Color. This property controls opacity of direction line. See example Map. With. Directions. aspx. Version 1. 6 (September 3, 2. It has been a long time since I updated this control. I got many requests for driving directions implementation, so I decided to release a new version. Following changes are done in this version. Here is how you can implement directions using new version. One more property is added as Directions in main control. You need to set Show. Directions=true and addresses in To. Address and From. Address. Download Source also provides a direction sample code. Special thanks to Vincent Blain who has provided source code for direction implementation. Version 1. 5 Following changes are done in this version. In previous versions javascript functions were embedded in Google. Map. For. ASPNet. In this version javascript functions are separated in Google. Map. APIWrapper. js file. This is done so that javascript source can be cached locally on client machine. Now you can change shadow image of a marker. Following new properties are added. Icon. Shadow. Image - Defines which image should be used for shadow. Image path should be given relative to root folder. Icon and Info. Window Anchor properties are now supported. Click on following link to view this documentation,Google Maps Control for ASP. Net - Part 2. Version 1. Following changes are done in this version. Geocoding is now supported in this version. You can find Latitude and Longitude value based on an Address. Here is how to do it. Google. Point GP = new Google. Point(). GP. Address = txt. Address. Text. //Geocode. Address() function will geocode address and set Latitude and Longitude of GP(Google. Point) to it's respected value. This was a bug in previous versions. See sample code below for new implementation. Recenter. Old version was getting stuck in design view. This version should work fine. This allows users to place control on web page itself and thus allowing them to use Ajax controls before Google Map Control. A small bug related to Satellite or Hybrid View is fixed. You can set Satellite View programatically as below. Google. Map. For. ASPNet. 1. Google. Map. Object. Map. Type = Google. Map. Type. SATELLITE. Added a new property called Recenter. Map. When it's set to true map will be re- centered and zoomed to default level on postback. Now you can add Tooltip for markers. Draggable pushpins are now supported. Version 1. 2 Following changes are done in this version. Version 1. 1 Following features are added in this version. Now you can draw polylines and polygons with this control A new property Google. Map. Object. APIVersion is added with this control. This will allow users to use any version of Google Maps API. Default version is 2.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |