ADS BY GOOGLE
Google Maps and ASP.NET
I am sure that most of you have heard about or have had a chance to use Google Maps. It's a great service and I was really impressed by the responsiveness of the application and the ease with which users could drag and zoom maps from a Web browser. It has in many ways heralded the arrival of AJAX (Asynchronous JavaScript and XML), which I am sure will revitalize Web development in the days to come.
Reader Feedback: Page 1 of 5

I got the same java script error in JScriptGenerator.cs
after replacing
sOverLayFunction.Append("try{this.overlays.push(a[i]); \n");

with
sOverLayFunction.Append("try{this.addOverlay(a[i]); \n");

Can You Please put your full JScriptGenerator.cs

i cant find a link to download the source code and the control. Please help.

Regards,
Sajid

I have created similar control. It works with latest versions of Google Maps API. Here is the link,

http://www.shabdar.org/google-maps-user-control-for-ASP-Net-part1.html

This one works with GMAP2

http://www.shabdar.org/google-maps-user-control-for-ASP-Net-part1.html

I have downloaded GMap control and sample applications.
But OverlayMarker and OverlayLine does not work.

Following code does not works. Please, tellme what is going wrong ? Suggest any modifications in code.

GMapControl1.Width=400;
GMapControl1.Height=400;
GMapControl1.MapType=MapControl.GMapType.MAP;
GMapControl1.ScrollControlType=MapControl.GMapScrollControl.LARGE ;
GMapControl1.ShowMapTypeControl=true;
GMapControl1.GoogleMapKey=ConfigurationSettings.AppSettings["DevKey"];
GPoint myPoint= new GPoint(36.1645,-86.7811);
GPoint myPoint2= new GPoint(36.224264,-85.928273);
string sFormattedHtml="Nashville<img src=D:\\MapPoint\\SourceCode_Murkoth0401\\SourceCode\\SampleSolution\\images\\image.gif /><a href= >Visit Nashville ";
// string sFormattedHtml = "hello";
GMarker myMarker= new GMarker(myPoint);
GMarker myMarker2= new GMarker(myPoint2);
GMapControl1.OverlayMarker(myMarker,sFormattedHtml);
GMapControl1.OverlayMarker(myMarker2, sFormattedHtml);
GMapControl1.CenterAndZoom(myPoint,9);

There is a change in google api and this shows a javascript error. So please remove "this.reOrderOverlays();" from GenerateNewOverLayFunction() in JScriptGenerator.cs file. You may find more info on this at http://groups.google.com/group/Google-Maps-API/browse_thread/thread/96fe...

This article is horrible. Very generic. Don't waste your time.

How do you deal with events ?
like moveend or dragend ?
Cheers

Here's the fix for the marker issue that everyone seems to still be having a problem with.

In JScriptGenerator.cs replace
sOverLayFunction.Append("try{this.overlays.push(a[i]); \n");

with
sOverLayFunction.Append("try{this.addOverlay(a[i]); \n");

the overlays.push is what looks to be causing the problem. After making this fix, I can lay markers on the map.

Cheers

Patrick -

Here is good easy to use control with full functionality. I did have a problem in deployment with the key, so I would recommend testing it on your server before you do a lot of development.

Hi Jeevan,
What an excellent tutorial and powerful tool. I spent many hours trying to find where the fix for the markers and line overlays might be, but (like everyone who has filled out 4 pages of feedback pleading for help with this) I was unable. I am not so great with Javascript, but read the rest of your code with great interest. I have looked far and wide for a similar tool, and although several exist they either use a newer version of .net from me or have some such other problem. Yours works beautifully except for the known issues.
What are we, the less than Code Grand Wizards, to do in order to convince Jeevan to rework the tool.
Could we put a PayPal donation box on the site and bribe you to do it?
Could we set the code up as a project on sourceforge.net and try to rework it that way?
Could you give us a slightly more specific hint about where the problem may lie in the code?
Could I name my next child Jeevan Murkoth, even if it is a girl?
If you might patch it in the next few months, could you let us know so that we don't abandon hope.

Hi Josh,
The control when written in 2005 was made to work with Google maps Beta 1. The current version is version 2. I assume that google has made some changes to the way markers are being displayed, hence some of you are having issues in getting them to display. I haven't had a chance to update the control for the new version.Since the source code is available, I'd encourage you to take a look at it.

Thanks

Great, but I kind of need to display markers. Its actually the key part of displaying the map. After playing around with this a while, markers or custom markers will not display. Several others had the same problem. Any ideas, or just skirting the issue?

Where do I go to download the GMap Control. I was lost trying to follow the step.

I have downloaded GMap control and sample applications.
But OverlayMarker and OverlayLine does not work.

Following code does not works. Please, tellme what is going wrong ? Suggest any modifications in code.

GMapControl1.Width=400;
GMapControl1.Height=400;
GMapControl1.MapType=MapControl.GMapType.MAP;
GMapControl1.ScrollControlType=MapControl.GMapScrollControl.LARGE ;
GMapControl1.ShowMapTypeControl=true;
GMapControl1.GoogleMapKey=ConfigurationSettings.AppSettings["DevKey"];
GPoint myPoint= new GPoint(36.1645,-86.7811);
GPoint myPoint2= new GPoint(36.224264,-85.928273);
string sFormattedHtml="Nashville<img src=D:\\MapPoint\\SourceCode_Murkoth0401\\SourceCode\\SampleSolution\\images\\image.gif /><a href= >Visit Nashville ";
// string sFormattedHtml = "hello";
GMarker myMarker= new GMarker(myPoint);
GMarker myMarker2= new GMarker(myPoint2);
GMapControl1.OverlayMarker(myMarker,sFormattedHtml);
GMapControl1.OverlayMarker(myMarker2, sFormattedHtml);
GMapControl1.CenterAndZoom(myPoint,9);


Feedback Pages:



ADS BY GOOGLE