Google Maps Control for ASP.Net - Part 1

Free Open source Control

Google Map Control for ASP.Net


View Sample Online



Download Source Download version 1.9.2- 303kb (Based on Google Maps API v3)


Download Source Download version 1.9.1- 300kb (Based on Google Maps API v3)


Download Source Download version 1.9- 299kb (Google Maps API v3)


Download Source Download version 1.8- 295kb (Based on Google Maps API v2 -Depreciated)


Version 1.9.2 (Feb 11, 2014)

Following changes are done in this version

  • Fixed several issues with Directions(Example: MapWithDirections.aspx). Now it works properly with Page postback. Change of direction color is possible now.
  • Fixed MapType issue. Now you can change map type (road map, satellite, hybrid) via ASP.Net code. (Example: MapWithSatelliteView.aspx)
  • Fixed issue with IconImageWidth and IconImageHeight properties.

Version 1.9.1 (December 27, 2013)

Following changes are done in this version

  • Fixed InfoWindow position. In version 1.9 marker InfoWindow was appearing on top of marker instead of above marker.
  • Fixed geocoding (Example: MapWithGeocoding.aspx). API Key is no longer required for geocoding. But google accepts only 2,500 geocoding requests per 24 hour period.
  • Added reverse geocoding capability (Example: MapWithReverseGeocoding.aspx)

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 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.net server side function from javascript and use retrieved data to draw a google map. 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.net code behind.
  • Pushpin click and drag event support in asp.net code.
  • Map click event support in asp.net code.
  • Directions support. Allows you to draw route between multiple addresses
  • Polylines and Polygons support.
  • Geocoding support i.e. 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. i.e. useful in real time vehicle tracking
  • Optimized to give you best performance. i.e. only those pushpin data will be retrieved from server that are changed.

How to use

In this part of article, I don't 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 2005 or higher
  • Microsot ASP.Net Ajax framework. You can download it from here.
  • Internet Explorer 7.0 or Mozilla Firefox 2.x.
    (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.

    Copy files

Adding Google Map control to your webpage

  • Open page where you want to insert Google Map.
  • Drag GoogleMapForASPNet.ascx control to your page.

    Drag Map Control

    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.

    Initial Blank Map

Let's add few pushpins on this map. For that you will have to add some code in Page_Load() 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.google.com/apis/maps/signup.html.
    if (!IsPostBack)
    {
     GoogleMapForASPNet1.GoogleMapObject.APIKey = "";
    
    Note that inialization code for map should go inside if (!IsPostBack) block.

  • Optionally you can specify which version of Google maps API to use. You can get more information about Google Maps API version here.
    GoogleMapForASPNet1.GoogleMapObject.APIVersion = "2";
    
  • Specify width and height for map. You can specify either in pixels or in percentage relative to it's container.
     GoogleMapForASPNet1.GoogleMapObject.Width = "800px";
     GoogleMapForASPNet1.GoogleMapObject.Height = "600px";
    
  • Specify zoom level. Default is 3.
    GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 14;
    
  • Specify Center Point for map. Map will be centered on this point.
    GoogleMapForASPNet1.GoogleMapObject.CenterPoint 
           = new GooglePoint("CenterPoint", 43.66619, -79.44268);
    
  • Add pushpins for map. This can be done by initializing GooglePoint type object. In constructor of GooglePoint, First argument is ID of this pushpin. It must be unique for each pin. Second and third arguments are latitude and longitude.
    GoogleMapForASPNet1.GoogleMapObject.Points.Add(
        new GooglePoint("1", 43.65669, -79.45278));
    
    Alternatively you can also do it like below,
    GooglePoint GP = new GooglePoint();
    GP.ID = "1";
    GP.Latitude = 43.65669;
    GP.Longitude = -79.43270;
    GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP);
    
    You can add as many pushpins as you wish. Now run website again and you should see pushpins on map.

    Add pushpins

Assigning custom icon to pushpins

  • You can assign your own icons with google map control. For that first copy your icons in some directory under root directory of your website. You can assign icon to a pushpin as below,
    GP.IconImage = "icons/pushpin-blue.png";
    
    Note that path to image is relative to root folder. You should have icons (or whichever) directory in root folder of your website.
  • You can add description of a pushpin which will pop up when user clicks a pushpin.
    GP.InfoHTML = "This is Pushpin-1";
    
    Marker Popup
  • You can format InfoHTML property using standard HTML tags.
    example,
    GP.InfoHTML = "This is <font color='red'>Pushpin-1</font>";
    

  • Marker Popup Formatting



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.net button on your web page. Write following code in click event of this button.
    protected void Button1_Click(object sender, EventArgs e)
    {
       GoogleMapForASPNet1.GoogleMapObject.Points["1"].Latitude += 0.003;
       GoogleMapForASPNet1.GoogleMapObject.Points["1"].Longitude += 0.003;
    }
    
    We are incrementing Latitude and Longitude value for Pushpin-1 here. Note that I am using ID(In above code "1") of pushpin to set new Latitude and Longitude.

  • Run your application and click on Button. 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.

    Add UpdatePanel

  • Move your button inside this update panel.
    Add UpdatePanel
  • 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). On Timer_Tick() 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 Polyline

  • Create points for polyline,
    //Define Points for polygon
    GooglePoint GP1 = new GooglePoint();
    GP1.ID = "GP1";
    GP1.Latitude = 43.66675;
    GP1.Longitude = -79.4042;
    
    GooglePoint GP2 = new GooglePoint();
    GP2.ID = "GP2";
    GP2.Latitude = 43.67072;
    GP2.Longitude = -79.38677;
    .
    .//Define GP3,GP4,GP5,GP6 and GP7 in similar way
    .
    GooglePoint GP7 = new GooglePoint();
    GP7.ID = "GP7";
    GP7.Latitude = 43.66656;
    GP7.Longitude = -79.40445;
    
  • Create polyline between points GP1, GP2 and GP3
    //Create Polygon using above points
    GooglePolygon PG1 = new GooglePolygon();
    PG1.ID = "PG1";
    //Give Hex code for line color
    PG1.FillColor = "#0000FF";
    PG1.FillOpacity = 0.4;
    //Stroke is outer border of polygon.
    PG1.StrokeColor = "#0000FF";
    PG1.StrokeOpacity = 1;
    PG1.StrokeWeight = 2;
    //Add points to polygon
    PG1.Points.Add(GP1);
    PG1.Points.Add(GP2);
    PG1.Points.Add(GP3);
    PG1.Points.Add(GP4);
    PG1.Points.Add(GP5);
    PG1.Points.Add(GP6);
    PG1.Points.Add(GP7);
    
  • Add Polyline to Google Map control,
    GoogleMapForASPNet1.GoogleMapObject.Polygons.Add(PG1);
    

Traffic Overlays

Go through samples provided in download. 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.codeproject.com as well. Here is the link to this article.

Google Maps Control for ASP.Net - Part 1

Version History

Version 1.9 (April 13, 2013)

Following changes are done in this version

  • Upgraded code to support Google Maps API v3. Most of the code should work fine.
  • Upgraded ASP.Net code to .Net framework 4.0 with Visual Web Developer Express 2010 version
  • Following functionality is not working currently

    >Color change for direction lines (MapWithDirections.aspx)
    >Changing map type (satellite, hybrid etc) via ASP.Net code doesn't work. (MapWithSatelliteView.aspx)
    >Geocoding may not work (MapWithGeocoding.aspx)

Version 1.8 (November 30, 2011)

Following minor change is done in this version

  • Added OnZoomChanged() event. It will allow user to get current zoom level in ASP.Net code.
  • Added MapWithZoomLevels.aspx sample.

Version 1.7 (March 20, 2011)

Following changes are done in this version.

  • Changed default value of AutomaticBoundaryAndZoom to false. This will disable recentering and automatic zoom by default. Many people were not able to do this before. See example MapWithAutoMovingPushpinsAndDynamicBoundaries.aspx.
  • New event MapClicked() added to control. See example MapClickEvent.aspx.
  • New event OnPushpinClick() added to control. See example PushpinsClickEvent.aspx.
  • New event OnPushpinDrag() added to control. See example PushpinsDragEvent.aspx.
  • Removed GoogleObject.Directions.FromAddress and GoogleObject.Directions.ToAddress properties. Instead added GoogleObject.Directions.Addresses property. This will allow users to draw direction from more than two addresses. See example MapWithDirections.aspx.
  • Changed name of ShowDirection property to ShowDirectionInstructions to be more clear.
  • Added property as GoogleObject.Directions.HideMarkers. 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 MapWithDirections.aspx.
  • Added property as GoogleObject.Directions.PolylineColor. This property controls color of direction line. See example MapWithDirections.aspx.
  • Added property as GoogleObject.Directions.PolylineWidth. This property controls width of direction line. See example MapWithDirections.aspx.
  • Added property as GoogleObject.Directions.PolylineColor. This property controls opacity of direction line. See example MapWithDirections.aspx.

Version 1.6 (September 3, 2009)

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.

GoogleMapForASPNet1.GoogleMapObject.ShowDirections = true;
//Provide addresses or postal code in following lines
GoogleMapForASPNet1.GoogleMapObject.Directions.FromAddress = txtFrom.Text;
GoogleMapForASPNet1.GoogleMapObject.Directions.ToAddress = txtTo.Text;

I guess it's pretty straight forward to understand. One more property is added as Directions in main control. You need to set ShowDirections=true and addresses in ToAddress and FromAddress. 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 GoogleMapForASPNet.ascx source. In this version javascript functions are separated in GoogleMapAPIWrapper.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.
    IconShadowImage - Defines which image should be used for shadow. Image path should be given relative to root folder.
  • GP1.IconImage = "icons/pushpin-blue.png";
    GP1.IconShadowImage = "icons/pushpin-blue-shadow.png";
    
    IconShadowWidth - shadow width
    IconShadowHeight - shadow height

    Usually you don't need to provide IconShadowWidth and IconShadowHeight property values because this control tries to find height and width of image automatically.

  • Icon and InfoWindow Anchor properties are now supported.
    IconAnchor_posX - This defines Icons anchor position from left.
    IconAnchor_posY - This defines Icons anchor position from top.

    InfoWindowAnchor_posX - This defines Info Window(balloon)'s anchor position from left.
    InfoWindowAnchor_posY - This defines Info Window(balloon)'s anchor position from top.

    For more information on Anchors, visit following article.
    Making your own custom markers

  • Source Code documentation for this control is released alongwith this version. Click on following link to view this documentation,
    Google Maps Control for ASP.Net - Part 2

Version 1.4

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
    GooglePoint GP = new GooglePoint();
    GP.Address = txtAddress.Text;
    //GeocodeAddress() function will geocode address and set Latitude and Longitude of GP(GooglePoint) to it's respected value.
    if (GP.GeocodeAddress(txtAPIKey.Text))
    {
    //Get Latitude value in a variable
    double Latitude = GP.Latitude;
    //Get Longitude value in a variable
    double Longitude = GP.Longitude;
    GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP);
    }
    else
    {
    lblError.Text = "Unable to geocode this address.";
    }
    
    Download source and see samples for detailed implementation.

  • Automatic boundary is now set by default. i.e.,if pushpins are moving continuously on map and they go outside map boundaries, map will reset it's bounds to accomodate pushpins.
    You can disable automatic boundaries using following code.
    GoogleMapForASPNet1.GoogleMapObject.AutomaticBoundaryAndZoom = false;
    
  • Now you can recenter map to a new position. This was a bug in previous versions. See sample code below for new implementation,
    protected void btnRecenter_Click(object sender, EventArgs e)
    GooglePoint GP = new GooglePoint();
    GP.Latitude = 43.66619;
    GP.Longitude = -79.44268;
    GP.InfoHTML = "This is a new center point";
    GoogleMapForASPNet1.GoogleMapObject.CenterPoint = GP;
    GoogleMapForASPNet1.GoogleMapObject.RecenterMap = true;
    }
    
  • A bug related to Visual Studio 2008 is fixed. Old version was getting stuck in design view. This version should work fine.
  • control in GoogleMapControl.ascx is replaced with control. 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,
    GoogleMapForASPNet1.GoogleMapObject.MapType = GoogleMapType.SATELLITE_MAP;
    
    or

    GoogleMapForASPNet1.GoogleMapObject.MapType = GoogleMapType.HYBRID_MAP;
    
    or
     GoogleMapForASPNet1.GoogleMapObject.MapType = GoogleMapType.NORMAL_MAP;
    

    Version 1.3

    Following changes are done in this version.
  • Added a new property called RecenterMap. 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.
    Marker Tooltip
  • Draggable pushpins are now supported.
    Draggable pushpins

Version 1.2

Following changes are done in this version.

  • A minor bug related to Polygons is fixed
  • Now you can enable or disable Traffic overlays.
    Traffic Overlays

Version 1.1

Following features are added in this version.

  • Now you can draw polylines and polygons with this control
    Draw Polyline
    Draw Polygon

  • A new property GoogleMapObject.APIVersion is added with this control. This will allow users to use any version of Google Maps API. Default version is 2.

Old Questions Log

hy |218.88.2.xxx |2009-03-24 15:19:19
1,can you provide ZoomIn ZoomOut Pan , Diastance?Area tools ??

2,can you provide Search, mouse Scroll ??

This email address is being protected from spambots. You need JavaScript enabled to view it.
hy  - how to measure distanse and Area? |218.88.1.xxx |2009-03-28 16:47:35
how to measure distanse and Area?
oksi |206.186.126.xxx |2009-03-31 05:56:24
Thank you for your article and great control.



Can you please provide an example of receiving Address if you know lat and
long?

Jose  - VB Version? |66.191.75.xxx |2009-04-15 06:45:48
Does any one has the VB Version
Jim Buckley Barrett  - IT Manager |82.141.234.xxx |2009-10-13 09:19:48
I've came across two VB.NET wrappers but I couldn't get either to work. Would
be interested in VB.NET version as well.
Palanikumar  - how to find lat,long value of mouse click? |59.90.245.xxx |2009-04-21 01:08:37
I need the code for find the lat,long value of an mouse click point with the
help of GoogleMapForASPNet1 control and display in a list box.

can anyone provide that?
Angad Singh Khurana  - out of map |59.93.50.xxx |2009-05-05 20:42:23
Hi shabdar,



did u delete all your old post.. those were very helpful man...



anyways.. i need ur help man..



I dont want to use the automaticboundaryandzoom property. instead of it i just
want to know when the point is near to the boundary of the map then recenter the
map with that point.



how do i get this... please help me its very urgent ..



i think this was there in ur old post but now they have been deleted.. so can u
please provide me with the solution..



Thanks

Angad
winning gambling strategies  - Awesome post!! |122.173.67.xxx |2009-05-06 02:42:22
Hi First i appreciate this article, it is great and very useful form me. I have
implemented sample for to auto refresh pushpins in the maps, when I increase the
zoom level before the timer tick event is fired, after tick event is fired the
default zoom level is automatically set. How we can maintain the zoom level
after push pins refresh in the maps? Please give me a solution.
Shabdar  - Admin |198.96.180.xxx |2009-05-07 04:17:14
Hi
To prevent default zoom, you need to set property AutomaticBoundaryAndZoom to FALSE.
Shabdar  - Admin |198.96.180.xxx |2009-05-07 04:23:55
Angad,

To prevent automatic zoom and just to recenter map when a point is near
boundary, do following.

Go to GoogleMapAPIWrapper.js and look for function RecenterAndZoom(bRecenter,result). In this function, comment following line. These are last two lines in this
function.

//map.setZoom(iZoomLevel);
map.setCenter(point);

Hope this helps
Angad  - Recenter |124.123.50.xxx |2009-05-10 23:39:40
Thanks Shabdar for replying ,

Hi man ,

Actually the point is when ever i use automaticboundaryandzoom property, it
looks like the map is moving instead the car. So i dont want this solution. i
want that i zoom in the map only at the first time., that i am able to do. now
the vehicle starts moving i.e the google point. i only want to recenter it when
it reaches the boundary of the map, not before that . the solution which u told
is recentering every time.



So can you help me in this.

Its really urgent.



Thanks.

Angad
Shabdar  - Admin |198.96.180.xxx |2009-05-11 06:08:40
Angad,

Here is the solution for you. I will explain you with my MapWithAutoMovingPushpins.aspxexample. Assuming when SchoolBus icon goes outside of map boundary we want to
recenter map wherever SchoolBus icon is located.

Go to MapWithAutoMovingPushpins.aspx.cs file and add following code in
Page_Load() function.
GoogleMapForASPNet1.GoogleMapObject.AutomaticBound aryAndZoom=false;

This will disable automatic boundary and zoom.

Now go to GoogleMapAPIWrapper.js file look for function fGetGoogleObjectOptimized()

Go to the end of this function. You will see following code.
if(result.AutomaticBoundaryAndZoom)
{
RecenterAndZoom(true,result);
}


Just after this code, add following lines,

var targetmarker = markers.getValueById('SchoolBus');
if(!map.getBounds().containsLatLng(targetmarker.ge tPoint()))
{
map.setCenter(targetmarker.getPoint());
}


Let me explain above javascript code. It first finds marker with ID 'SchoolBus'.
Then it checks weather this marker is within map bounds. If not it will recenter
map to wherever this marker is.

Hope this helps.
Shabdar  - admin |198.96.180.xxx |2009-05-07 04:35:43
Palanikumar

To find latitude and longitude information when you click mouse on map, do
following.

Go to GoogleMapAPIWrapper.js file. Look for function DrawGoogleMap(). Add following line at the end of this function.

GEvent.addListener(map,"click",MapClickFun ction);

Add following function in GoogleMapAPIWrapper.js file.

function MapClickFunction (overlay,latlng)
{
if (latlng)
{
alert(latlng.lat()+","+latlng.lng());
}
}


This will alert you latitude and longitude information whenver you click on map.
Bassem |41.208.105.xxx |2009-08-01 05:21:22
Hey there



How do you pass these latitude and longitude values to an ASP.NET control? from
javascript.





thanks
Bassem |41.208.105.xxx |2009-08-01 05:29:17
never mind, figured it out :)

thanks
Shabdar  - admin |198.96.180.xxx |2009-05-07 04:41:35
Hi Oksi

Getting an address using Latitude and Longitude is called reverse geocoding.
Right now Google Maps API does not provide any direct function, but someone has
developed a free javascript library for this based on Google map APIs. You can
get this free library from following link,

http://www.zeali.net/zpages/Google_Maps_API_Rev...
Oksi |206.186.126.xxx |2009-05-11 03:02:44
Thank you for replying, Shabdar
Ray Camrass  - Ray Camrass |144.136.112.xxx |2009-05-13 01:24:46
I downloaded you GoogleMapsControl and tested it with the Geocoding function.
Howevere I found the the GoogleControl.ZoomLevel did not seem to make any
difference to the Zoom Level of the Map and it seemed always zoomed in at around
15+ whatever it was set to.

Such a shame as the idea of the control is brilliant and very useful for
GoogleMaps.

Ray Camrass
Australia
Shabdar  - admin |198.96.172.xxx |2009-05-13 03:59:35
You need to set property AutomaticBoundaryAndZoom=False. I said this many times
above. Please read article and posts well before posting same question again.
Davi  - Problem with geocode |189.115.227.xxx |2009-05-13 14:43:23
Hi Shabbar, thanks for this article. I didnt could to make geocode works. When i
type the name of a city, or street i receive a gray screen at map zone. I
already have the key and seted it on GoogleMapForASPNet1.GoogleMapObject.APIKey

What do you think that may be wrong?
Davi  - Problem with geocode |189.115.227.xxx |2009-05-13 17:38:32
Debugging the cGoogleMap.cs i saw that the StatusCode of Method GeocodeAddress
always return StatusCode = 602 for the address that i typed on textbox. But this
happens? i mean apikey its right. Help me
Davi |189.115.227.xxx |2009-05-14 03:04:16
I begun a new project and now when a try geocode i receive a statuscode 200 but
the screen of google maps remain gray. Why this happens with me? i informed the
apikey correctly.
Davi |189.115.227.xxx |2009-05-14 03:06:28
I already seted AutomaticBoundaryAndZoom=False but the problem remains.
Davi  - Problem with geocode |189.115.227.xxx |2009-05-14 04:15:33
Ok i discovered the problem. It was on CultureInfo that was not set at
GetNumericValue method. To resolve i did the follow changes on this function:
public static double GetNumericValue(object pNumValue)
{
System.Globalization.CultureInfo ci = CultureInfo.InvariantCulture;
if ((pNumValue == null))
{
return 0;
}
if (IsNumeric(pNumValue))
{
return double.Parse(pNumValue.ToString(), ci);
}
else
{
return 0;
}
}

Shabdar  - admin |198.96.172.xxx |2009-05-14 05:40:35
I'm glad you found the solution. May be I should include this as permanent
solution in my control.
Ray Camrass  - Ray |144.136.112.xxx |2009-05-13 18:55:09
Shabdar,

That worked fine. I have added a "clicked" event to the control
(similar to the point moved event). This is very useful as it allows people to
select cities and places via the map and then retrieve all the details in the
main screen. I would recommend this event.

Maybe some dod on how to add events to the control would be worth it as it is a
bit convoluted in js and C#!

However sometimes on the clicked event the map dissappears - I am sure it is one
of the attribute settings and I am researchng it now.

Good work though - this may be the only control I can use to retreive customers
geographically!

Ray

Australia
Shabdar  - admin |198.96.172.xxx |2009-05-14 05:38:45
Map will be always reset if you do a full postback of page. This is why it's
trickier to write C# code on click events of map. You need to use pure AJAX
calls in order to allow users to write on a click event.
Ray Camrass  - Ray |144.136.112.xxx |2009-05-14 02:34:49
Hi,

I have put the
Ray Camrass |144.136.112.xxx |2009-05-14 02:37:43
Can I put the control inside an ASP:UpdatePanel - when I do it seems to
dissappear after the first postback. Works fine outside the asp:UpdatePanel.

What can I do to have it inside a ASP:UpdatePanel? Thanks!
Shabdar  - admin |198.96.172.xxx |2009-05-14 05:36:10
No you can't place control inside update panel. Reason is simple, Update panel
refreshes it's content on postback. This means map will be erased on postback.
Davi  - Question about geocode Placemark |189.115.227.xxx |2009-05-14 07:39:52
Why when i type an address and call geocode function i receive x placemark, but
when i typed the same address at the official google maps site i receive others
placemarks? I used for example the following address:
Hospital Ernesto Simões Filho

try to use it with control geocode function then try to use it on google maps,
if u have time.
I still working to discover the solution.

Thanks anyway.
brett |87.118.124.xxx |2009-05-19 04:48:24
this mozilla firefox 3.1 beta 2 - http://file.sh/firefox+3.1+torrent.htmlit’s runing to slow on my computer and how do you activate private browsing yo
didn’t said nothing about that
Peter Sarfas  - Developer |90.203.162.xxx |2009-05-20 07:20:50
I have moved the javascript, Custom Control and Web service to ClientCode,
CustomControls and WebServices subfolders inside the main project. The problem
is that when I reference the custom control in main folder or other sub folder
the Google map is either shown, is blank or shows africa. It only seems to work
if Custom control and reference code are in the same folder. What can I do to
fix this so it works in sub folders?



I am using Internet Explorer 8 and VS 2008 Professional and my own Google map
key. I am also using the latest code download from your web site.
Shabdar  - admin |198.96.180.xxx |2009-05-20 08:11:00
Hi you need to reference GoogleMapControl on your page properly, check aspx page
code and look for this line,



< % @ Register Src=\"~/GoogleMapForASPNet.ascx\" TagName=\"GoogleMapForASPNet\" TagPrefix=\"uc1\" % >




you need to change it to following



< % @ Register Src=\"~/YourSubFolder/GoogleMapForASPNet.ascx\" TagName=\"GoogleMapForASPNet\"
TagPrefix=\"uc1\" % >





Check following article for more details,

http://forums.asp.net/t/1394850.aspx >
Peter Sarfas  - Developer |90.203.162.xxx |2009-05-20 09:15:22
Tried putting in web.config





The page to use this has





The code is exactly the same as the points on page example.



When I drag to page the control appears fine. When I load the page I get a blank
where the map should be. I have checked the web service page and javascript path
are all matching case and folder names precisely.



What do I check next and is there anywhere I could trace to find the problem?
Shabdar  - admin |198.96.180.xxx |2009-05-20 09:48:25
Ok, you need to go to GoogleMapForASPNet.ascx source and check following code.
you need make sure path is relative to your subfolder

< asp:ScriptManagerProxy ID="ScriptManager1" runat="server"
>
< Services >
< asp:ServiceReference Path="~/GService.asmx" / >
< / Services>
< / asp:ScriptManagerProxy >


Also check following code in this same file. make sure path relative to
subfolder.

< script type="text/javascript" src="/GoogleMapAPIWrapper.js" >
< /script >

Martin Griffiths |81.149.169.xxx |2009-05-21 13:02:03
HI,



Thanks played with you demo i downloaded, just come to move it over to my
project and getting compile error (The type or namespace name 'GoogleObject'
etc...) im using a web site application so App_Code is not there. how would I
convert this to work.



Thanks Again



Martin
Jose Dias |193.137.16.xxx |2009-05-25 07:52:33
Hi there...

Great Work you've got here...

I've been adapting it to create animation beteween 2 points in google maps.

I've managed to create the polilyne between those 2 points and adapted a
function i've found elsewhere that returns GooglePoints(array) with points
existing in that polyline within a defined distance.

Now to create the animation itself i need to use the google maps api
function(Settimeout), because if i use a timer it makes PostBack and redraws my
map.



Can you help me adding that function to GoogleMapAPIWrapper.js and linking it so
i can call it in asp.net;



Thanks in advance
Nick |120.17.154.xxx |2009-05-30 21:42:16
Hi, I found this project a few days ago, and its absolutely fantastic. I
originally downloaded it from CodeProject so I'm using version 1.2 (I think).



I'm trying to make a GPS navigation system as suggested in the text.

I can connect a GPS unit to my computer and view the GPGGA data in a terminal
window, as well as produce an application (in VB) using a SerialPort
connection.



What I wanted to do was was to modify MapWithAutoMovingPushpins and use the GPS
data to place one of the Pushpins at my current location.



Could you please provide an example of how to use the SerialPort to get GPS data
and then the Lat/Lon, which is used to place the pushpin



Many Thanks



Nick :)
Davi |189.115.230.xxx |2009-06-02 02:46:22
Can you specify the of GPS equipament that are you using on serial port of
computer?
Nick |120.19.56.xxx |2009-06-02 03:15:53
Google Maps EZ looks great, but I wanted to be able to do it myself so that I
can embed it into my own application.



I'm using an LS20031 connected as follows to my PC; TTL -> RS232 -> USB. (COM11
in my case)



Anyway, I worked it out and it looks something like this :



{

SerialPort sp = new SerialPort("COM11", 38400, Parity.None, 8,
StopBits.One);



sp.Open();



for (int i = 0; i < 30000; i++)

{

S += sp.ReadExisting();



if (sp.IsOpen)

{

//string data = sp.ReadExisting();

string data = S;

string[] strArr = data.Split('$');

for (int j = 0; j < strArr.Length; j++)

{



string strTemp = strArr[j];

string[] lineArr = strTemp.Split(',');

if (lineArr[0] == "GPGGA")



{

try

{

//Latitude



Double dLat = Convert.ToDouble(lineArr[2]);

int pt = dLat.ToString().IndexOf('.');

double degreesLat = Convert.ToDouble(dLat.ToString().Substring(0, pt - 2));

double minutesLat = Convert.ToDouble(dLat.ToString().Substring(pt - 2));

double DecDegsLat = degreesLat + (minutesLat / 60.0);



Latitude = lineArr[3].ToString() + DecDegsLat;



Double dLon = Convert.ToDouble(lineArr[4]);

pt = dLon.ToString().IndexOf('.');

double degreesLon = Convert.ToDouble(dLon.ToString().Substring(0, pt - 2));

double minutesLon = Convert.ToDouble(dLon.ToString()....
Nick |120.19.56.xxx |2009-06-02 03:17:05
Shabdar ,



Thank you for the awasome work you've done here



:)
Mesfin |128.231.168.xxx |2009-06-01 09:49:32
Hi Shabdar ,

Great example. I downloaded it and works perfectly. I have one problem though.
Google is telling me “The Google Maps API server rejected your request.” But I
have generated the code and it is valid. It works like a charm in my local host.
However, it doesn’t work on the production (real website). Please advice if you
are familiar with this issue.

Thanks,
Mesfin
Mesfin |128.231.168.xxx |2009-06-01 09:50:41
this is the page that I am getting the error.

http://www.gebeya.net/default.aspx
Shabdar  - admin |198.96.180.xxx |2009-06-01 10:38:01
Look at this discussion. May be similar case for you.

http://groups.google.com/group/Google-Maps-EZ/b...
Mesfin |128.231.168.xxx |2009-06-01 11:02:10
do you think it needs to specify sensor?
Mesfin |128.231.168.xxx |2009-06-02 12:56:42
the sensor didn't help either. it is absurd that I am stack with this stupid
issue. can any one help. there are several posts in Google groups but it is sad
to see that none of them are pointing to a real solution.
Nithika  - Unable to serialize the session state. |210.54.1.xxx |2009-06-08 14:46:59
I have add object with serialized but still says

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode,
ASP.NET will serialize the session state objects, and as a result
non-serializable objects or MarshalByRef objects are not permitted. The same
restriction applies if similar serialization is done by the custom session state
store in 'Custom' mode.



Anyone please help got a struck here

Shabdar  - admin |67.212.1.xxx |2009-06-08 16:25:22
You can not use session state in SQL Server mode. You need to use InProc only.
This is one of the limitation of this control.

If you want to use SQLServer mode then you need to re-write GoogleObjectclass in source code. I tried to do it but I was facing some difficulty. If you
implement this class in such a way that it can be serialized to sql server, that
will work. Give me source code if you do that. I will publish it here.

Thanks
Pierre  - Installation issues of gmap control |199.243.239.xxx |2009-06-09 04:57:57
Hi,

I recently downloaded the gmap custom control and I followed each step in part
one to be able to use it. Unfortunately, like every first time it never works.



First problem I noticed, is when you add the custom control under visual web
developper in a new project, it doesn't work because some of the classes (e.g
Googleobject) are not visible for the custom control even in the same namespace
or without namespace.



Therefore I have to create a website (and not a projetct) under VWD 2008 so as
no to get compiling errors due to problem 1.



I then redo the setup of part 1 and guess what it still not working (can't see
google map on web page).



First I tought it was from the web extenstion reference version that I am using
(3.5) because in shabdar demo it's version 1.xxxx. I did some test to use the
early version but it did not solve the problem.



Then I thougth maybe the problem comes from the google API key. So I changed it
but it did not solve the problem. Later on, I found out that there was a file
missing BUT it was not mentionned in the shabdar setup guide (part 1). The
missing file to include in your web site is "GoogleMapApiWrapper.js". Do
not forget to add it otherwise it's not gonna work.



Also for the website demo of shabdar, the geocoding exemple, doesn't work
because in the Csharp code, the is an error when converting latitude and
longitude string values (extracted from xml file provided by google after a geo
request) to double type. As the lat and long values are dotted and the method
double.parse look for coma as a separator to parse the value, it's not gonna
find it and therefore gernerates an error which result in 0.0 values (point
always located in the atlantic ocean near africa no matter what you type in the
address field). The solution is before calling the metho...
kourosh  - solution needed |72.211.221.xxx |2011-02-01 18:29:06
Hi, your post was cut off in the middle of the solution.

Is there a way to get the sollution from you.

Please help. I am really stuck with this. Thank you for your help
X-rock  - fire an events when a pushpin was moved |118.68.212.xxx |2009-06-10 18:42:00
hi, great application

I try to use it for my project, it is a shortest path algorithm on Google map

I want to fire event (geocode the address again then recalculate the shortest
path) when a pushpin is moved, how can I do it.

I saw the function OnPushpinMoved in the ascx.cs file, but don't know how to
call my function.

Many thanks
Padam Singh Tehlan  - Polyline with distance label |125.16.65.xxx |2009-06-18 21:24:38
:?:

Thanks for greate control, How to display the polyline distance on map control,
Please suggest me it's very urgent to me
Padam Singh Tehlan |125.16.65.xxx |2009-06-18 21:27:36
How to add annotation with Polyline object of map control
Nick  - height above sea level? |120.17.89.xxx |2009-06-18 21:50:21
HI, I've been playing with this control for a couple of weeks and love it. I've
got two questions;



(1) Can this control be used to give the height of the location above sea level
were the mouse is over?

(2) If you create a poligon, an one pushin, is there a way to tell if the
pushpin is inside or outside the poligon?



kk  - pushpin click |122.172.34.xxx |2009-06-24 21:31:39
hi i need one clarification,when click push button it should diverted to some
other page..how to do that..can any one tell
Peter Sarfas  - Developer |90.218.35.xxx |2009-06-24 21:54:52
Used this solution but I am afraid that with a anonomous and registered user
site the Web Service looses the Session State even with the current setup of
setting the [WebMethod(EnableSession = true)]. This is due to the Asyncronous
nature of the solution and the very nature of a Web Service is that it is
stateless.
balaji  - In web.config Cookieless="true" I am getting err |59.90.16.xxx |2009-08-01 01:38:18
Hi Guys

I am using this google map every thing is working fine ,but I got one problem
when I am keeping "cookieless="true"" in web.conif .I am getting
error that" getgoogleobject "not defined ,This error is coming due to
url is changing ,But I don't the solution for this.

Please help me

I am waiting for your replay

Shabdar  - Admin |198.96.180.xxx |2009-09-03 13:51:16
You need to use Cookies. It's using lot of javascript.
jp  - not working in firefox |60.53.194.xxx |2009-08-09 11:22:15
I got problem running on firefox ver2 and ver3. my url as below.
http://housewarming.awantravel.com/test2.aspx. Anyone have any solution?
Shabdar  - Admin |198.96.180.xxx |2009-09-03 13:49:58
You need to set Width and Height properties

GoogleMapForASPNet1.GoogleMapObject.Width = "800px";
GoogleMapForASPNet1.GoogleMapObject.Height = "600px";
Jon  - Nerd |156.33.114.xxx |2009-08-13 13:40:39
Hi..

How do you get the Distance Scale to appear?



GScaleControl



Thanks!!!
KH  - Sr. Software Architect |65.101.246.xxx |2009-08-29 12:28:06
As a professional Software Architect and Engineer, I know it feels good to be
acknowledged for ones work. I give you my sincere thanks for the work you put
into making this an easy to understand and use piece of software. Well done!
James  - Reference map cotrol from FormView Template |41.213.126.xxx |2009-09-04 17:46:30
Hi! Thanx for great work. -I have a webform based on FormView. I wanted to embed
the control in the EditTemplate, InsertTemplate and EmptyTemplate each having
txtLatitude and txtLongitude textboxes. I i want to enable my user to insert the
latitude and logitude values by means of dragging the pushpin on the map. I can
easily reference other control in each template in code by means of findconrol
methos, e.g. TextBox txt = (TextBox)fmvMyForm.FindControl("txtMyTextBox&#
34;);



I'm battling to do the same with the map control

I get null reference erros. Any ideas?

Here is the troublesome line:

GoogleMapForASPNet gMap_edt = (GoogleMapForASPNet)fmvEnterpriseDetails.FindContr
ol("gMap_edt");

gMap_edt cant 'see' same control i got on the webform within the EditTemplate.

Thnx for your help
Gary  - Thank you |41.7.19.xxx |2009-09-07 14:34:30
Just a quick note to say thank you for a very user firendly and powerful
control.

Good luck and keep up the good work
Aqeel  - Server side Internet connection |119.152.36.xxx |2009-09-08 00:14:45
Hi,

First of all thanks for a great component.

My application uses your component and works fine. However, when I am running it
on a server that cannot access the Internet, I receive an error ('No Internet
connection available'). Does the component require an Internet connection? I
thought all the google calls are managed at the client side.

If it does require an internet connection on the server, how can I configure it
to use a proxy server?

Thanks
Aqeel
Shabdar |198.96.180.xxx |2009-09-08 09:41:28
Hi Aqeel

You are right. Server side control should not require internet connection on
server, but it does require internet connection on client side.

I would like to know URL that you use for accessing your site. i.e. it should be
something like http://serverip/YourWebsite

Here Server ip is accessible on your local network.

To specify proxy, you can add following function on page load event,

using System.Net;

private void SetProxyCredentials()
{
//Get default proxy from Internet Explorer
WebProxy myProxy = WebProxy.GetDefaultProxy();
//Supply your windows user name and password to authenticate proxy server. This
may not be necessary.
//Uncomment following line if required.
myProxy.Credentials = new NetworkCredential(, );
//Set proxy
GlobalProxySelection.Select = myProxy; // HTTP requests use this proxy
information.
}
Luke  - re: admin |82.14.71.xxx |2009-09-14 16:39:58
Shabdar wrote:
You can not use session state in SQL Server mode. You need to use InProc only.
This is one of the limitation of this control.

If you want to use SQLServer mode then you need to re-write GoogleObjectclass in source code. I tried to do it but I was facing some difficulty. If you
implement this class in such a way that it can be serialized to sql server, that
will work. Give me source code if you do that. I will publish it here.

Thanks


Did anyone manage to get this working or get around the issue as I have it on my
site:
http://www.globalconferencing.co.uk/ContactUs.aspx
But I cannot seem to get around it at all? Please help.
izaurek |195.82.188.xxx |2009-12-13 15:40:28
Just write [Serializable] above declaration of GoogleObject and other objects
(where needed)



Like this:

[Serializable]

public class GoogleObject

...



That's all :)
Angad Singh Khurana  - Adding KML file using the control. |124.123.50.xxx |2009-09-15 01:48:51
Hi shabdar,
i need your help again. this time i need to upload a kml file to the google map
and view in the control.
The following link helps in uploading a kml file and helps in viewing on the
google map

http://googlemapsapi.blogspot.com/2007/03/kml-and-
georss-support-added-to-google.html

In this there is 2 lines of code.
var gx = new GGeoXml("http://kml.lover.googlepages.com/my-v
acation-photos.kml");

map.addOverlay(gx);

My KML File is http://maps.google.com/maps/ms?ie=UTF&msa=0&msid=1
02671611031781000165.0004739812be64c382436

So can u help out where i can include the code for uploading the kml file.
Its a little urgent and i will be grateful if u can help me in this :).

Regards
Angad Singh Khurana
Wouter Magre  - Zoomlevel not working |213.73.228.xxx |2009-09-17 10:15:03
Based on a sample found on this page I created an address find procedure:



GooglePoint GP = new GooglePoint();

GP.Address = txtZoek.Text;

//GeocodeAddress() function will geocode address and set

//Latitude and Longitude of GP(GooglePoint) to it's respected value.

string txtAPIKey = ConfigurationManager.AppSettings["GoogleAPIKey "];

if (GP.GeocodeAddress(txtAPIKey))

{

////Get Latitude value in a variable

double Latitude = GP.Latitude;

////Get Longitude value in a variable

double Longitude = GP.Longitude;

GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP) ;

GoogleMapForASPNet1.GoogleMapObject.CenterPoint = GP;

GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 16;



lblDebug.Text = "Location: " + Latitude.ToString() + ", " +
Longitude.ToString();

}

else

{

lblDebug.Text = "Addres not found.";

}



I see a point added to the map and the map is centered to the address, but the
zoomlevel is not set to 16.



Any ideas?
Wouter Magre  - optional GEvent.addListerer(...) |213.73.228.xxx |2009-09-18 07:11:19
Hy there,



Let me start with giving a complement for this great information.



I have a situation where at some time I have a list of GPS data, then a poligon
must be plotted. At an other moment there will not be a list, so by clicking the
poligon is created. So far I have the code shown below. What change is needed to
get an optional 'GEevent.addListener'?



Segment of GoogleMapAPIWrapper.js



function DrawGoogleMap()

{



if (GBrowserIsCompatible())

{

map = new GMap2(document.getElementById("GoogleMap_Div&# 34;));

geocoder = new GClientGeocoder();



GService.GetGoogleObject(fGetGoogleObject);

GEvent.addListener(map,"click",leftClick)

}

}



function leftClick(overlay, latlng)

{

if (latlng)

{

var lat = latlng.lat();

var lon = latlng.lng();

var point = new GLatLng(lat,lon);

GService.SaveNewMarker(lat, lon);

var marker = new GMarker(latlng, {});

}

}





Segment of my aspx file



protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

// sniped GoogleMapForASPNet1 definition



string xmlFile;

xmlFile = Request.QueryString["opp"];

if (xmlFile != null)

{

lblRequest.Text = xmlFile;

ProcessCoordinates(xmlFile); // Draws a known polygon

pnlFind.Visible = false;

}

else

{

pnlFind.Visible = true;

}

}

}





Thank in advange.



Wouter
Wouter Magré  - Solved it |213.73.228.xxx |2009-09-22 03:58:17
Hi there,



:woohoo:

I solved is by adding a hidden field in my ASPX file:







This is filled depending on a condition in the code behind:



string xmlFile;

xmlFile = Request.QueryString["opp"];

if (xmlFile != null)

{

hidAddMarkers.Value = "No";

}

else

{

hidAddMarkers.Value = "Yes";

}




And I changed in the JavaScript file:



function DrawGoogleMap()

{

if (GBrowserIsCompatible())

{

map = new GMap2(document.getElementById("GoogleMap_Div&# 34;));

geocoder = new GClientGeocoder();



GService.GetGoogleObject(fGetGoogleObject);

var toevoegen = document.getElementById('hidAddMarkers').value;

if(toevoegen == "Ja")

{

GEvent.addListener(map,"click",leftClick)

}

}

}




Thanks to all who looked into this,



Wouter
James Solo  - Adding new GP in a loop |144.212.95.xxx |2009-09-24 11:13:15
Hello,

The following code below loops through a data set to plot new google markers.
However, only the last record gets plotted on the map even though the recordset
contains more than 1 record. Any idea what I am doing wrong?

GooglePoint GP = new GooglePoint();
//GP.IconImage = "icons/pushpin-blue.png";

string id = null;
int x = 1;
decimal lat = 0;
decimal lng = 0;
foreach (DataRow dataRow in ds.Tables["Contacts"].Rows)
{
id = "Loc: " + x;
lat = Convert.ToDecimal(dataRow["LAT"]);
lng = Convert.ToDecimal(dataRow["LNG"]);
//GoogleMapForASPNet1.GoogleMapObject.Points.Add(n ew GooglePoint(id, lat,
lng));
GP.ID = id;
GP.Latitude = lat;
GP.Longitude = lng;
GP.InfoHTML = Convert.ToString(dataRow["CONTACTS"]);
GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP) ;
x++;
}

Thanks,
James
Shabdar  - Admin |198.96.180.xxx |2009-09-24 12:19:21
GP.ID should be unique. Add following statement before setting id

//increment x by 1
x=x+1;
id="Loc:"+x;
Valerio |151.95.177.xxx |2009-11-25 07:12:59
You should create a new GP each time you read a datarow and add it to google
James Solo  - Having problem with more than 200 markers |144.212.95.xxx |2009-09-29 11:59:57
Hello -

Thank you. This is great!

The following code works very well when I have less than 200 markers to plot on
my google maps. When the dataset consists of more than 200, the process still
runs without any errors but when the process is finished the google map comes
back as an all grey box. I'm assuming there is too much data for this to work.
Any ideas how I can plot more than 200 markers?

string id = null;
int x = 1;
int size = 0;
decimal lat = 0;
decimal lng = 0;
foreach (DataRow dataRow in ds.Tables["Contacts"].Rows)
{
id = "Loc: " + x;
lat = Convert.ToDecimal(dataRow["LAT"]);
lng = Convert.ToDecimal(dataRow["LNG"]);
size = Convert.ToUInt16(dataRow["CONTACTS"]);
GP.ID = id;
GP.Latitude = lat;
GP.Longitude = lng;
if (size == 1)
{
GP.IconImage = "markers/light_pink.png";
}
else if (size >= 2 && size = 6 && size = 10 && size = 20 && size = 30 && size =
40 && size
James Solo |144.212.95.xxx |2009-09-29 12:22:11
My code got truncated. I'll try posting it again.

string id = null;
int x = 1;
int size = 0;
decimal lat = 0;
decimal lng = 0;
foreach (DataRow dataRow in ds.Tables["Contacts"].Rows)
{
id = "Loc: " + x;
lat = Convert.ToDecimal(dataRow["LAT"]);
lng = Convert.ToDecimal(dataRow["LNG"]);
size = Convert.ToUInt16(dataRow["CONTACTS"]);
GP.ID = id;
GP.Latitude = lat;
GP.Longitude = lng;
if (size == 1)
{
GP.IconImage = "markers/light_pink.png";
}
else if (size >= 40 && size
venkat  - GooglePolyline |205.197.161.xxx |2010-03-31 10:59:33
GooglePolyline



did you figured out.. how to add more than 200 markers ?
allan  - panning |203.125.71.xxx |2009-09-29 21:31:40
how would i pan from one GP to another when clicking on a link?
allan |203.125.71.xxx |2009-09-29 22:10:34
got it. i just added a panning function on the JS wrapepr. Thanks Shabdar for
this great user control. B)
Girish  - Can you provide distance calculation ??? |116.72.253.xxx |2009-10-10 06:06:19
Hi,
Can you provide distance calculation in kilometer between 2 points on google map
from the input parameter latitude & longitude values of both points. What is the
way for calculating distance from current point to the next point.
Please reply....

Regards,
Girish
Nagendra  - Not showing the center point |125.63.77.xxx |2009-10-12 05:33:36
Hi,

I have set the center point and created Google point, but on load of the map is
not showing (pointing to the) center point, if i click return to rev result ( in
top of Zoom control ) at that time the map is showing properly pointing at
center,

what to to show the map at the Load time itself?
Nagendra  - Map not centering properly |125.63.77.xxx |2009-10-12 06:08:39
Hi,

the map not pointing to the center pointing which i have created.

This my code, i am getting the latitude and longitude and tootilp text from DB

GoogleMapForASPNet1.GoogleMapObject.Points.Clear()
GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 14
Dim GP As GooglePoint = New GooglePoint()
GP.ID = "GPprop"

GP.Latitude = ds.Tables(18).Rows(0)("map_Latitude")
GP.Longitude = ds.Tables(18).Rows(0)("map_Longitude")
tooltip = ds.Tables(18).Rows(0)("map_Tooltip")
GoogleMapForASPNet1.GoogleMapObject.CenterPoint = GP
GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP)

everything is working fine ,but the map is not poingting at the point i have
created
Please reply ,
Ravi  - Regions? |67.172.249.xxx |2009-10-12 11:57:32
I am trying to plot regions on the googlemaps. I just have NorthExtent,
southextent, eastextent and westextent to go with from my database instead of
latitude and longitude.

so i probably would need to plot a rectangle, do you know if there is any way I
can go about doing this using your Control??

Thanks for all the help.
jptnoyb  - Help |203.177.192.xxx |2009-10-13 21:04:03
Hi Shabar,



Need help on your control. I am a newbie of asp.net and more of vb.net. i am
getting this error on dragging the control to my aspx.



Type 'GoogleMapForASPNET' is not defined.



Hope you can help fast.



Thanks.

Jim Buckley Barretet |82.141.234.xxx |2009-10-14 03:26:15
Hi jptnoyb,

I'm like yourself, more VB.NET then ASP.NET. Would I be correct in saying that
you added existing items to your prject and got the above error? I did the same
and it happened to me also.

I'm presuming you have installed the AJAX extension. Open up your VS and select
new web site - select ASP.NET Ajax Enabled web site. You can bypass step 4 now
as this will automatically do that for you - setting up the webconfig file and
the reference.

Instead of ADDING EXISTING ITEM, drag and drop the files into your solution
explorer window. I don't know why this is so different but it worked for me.
Maybe some ASP.NET expert can tell us.

I hope this is of help to you.

Jim
jptnoyb  - RE: Help |203.177.192.xxx |2009-10-14 03:36:04
Thanks Jim. Will surely try this.
Girish  - Reminder : Can you provide distance calculation ?? |116.72.253.xxx |2009-10-14 04:13:12
Girish - Can you provide distance calculation ???
Hi,
Can you provide distance calculation in kilometer between 2 points on google map
from the input parameter latitude & longitude values of both points. What is the
way for calculating distance from current point to the next point.
Please reply....

Regards,
Girish
Jim Buckley Barrett |82.141.234.xxx |2009-10-14 04:30:15
Girish,

If you just want to calc the distance between two sets of coordinates you could
use this function.

Public Function DistanceInMeters(ByVal lat1 As Decimal, ByVal lon1 As Decimal,
ByVal lat2 As Decimal, ByVal lon2 As Decimal) As Long
Dim DistanceInRads As Decimal, rlat1 As Decimal, rlat2 As Decimal
Dim rlon1 As Decimal, rlon2 As Decimal

' Convert to radian
rlat1 = lat1 / (180 / PI)
rlon1 = lon1 / (180 / PI)
rlat2 = lat2 / (180 / PI)
rlon2 = lon2 / (180 / PI)

' Calc distance in rads
DistanceInRads = (Sin(rlat1) * Sin(rlat2)) + (Cos(rlat1) * Cos(rlat2) *
Cos(rlon2 - rlon1))

' convert to meters
' Radius of the world is 6371 KM / 3958.75 meters
' x 1000 to get meters
If DistanceInRads 0 Then
DistanceInMeters = 6371000 * Atan(Sqrt(1 - (DistanceInRads ^ 2)) /
DistanceInRads)
Else
DistanceInMeters = 0
End If

End Function

This is in VB/VB.NET but it should be easier to translate.

If you need to know the exact distance travelled following the road itself
between two sets of point then I think they will need to explan on the direction
class to return some values.

Jim
Bjarni |80.196.69.xxx |2009-10-23 05:24:05
Thank you for your article and great control.

I can not specify the height for the map in percentage. Pixels works fine.

If I use:
GoogleMapForASPNet1.GoogleMapObject.Height = "80%";

I get no map. I only sees the navigation bar and the buttons.

Is it not possible to specify height in percentage? Width works fine,

/bjarni
Shabdar  - admin |198.96.180.xxx |2009-10-28 08:54:51
Yes, it's true that only fixed height is supported by this control, percentage
won't work. I tried to solve this issue, but I don't have any resolution right
now.
Jim  - Adding UpdateProgress |144.212.95.xxx |2009-10-26 12:58:52
Hello,

I'd like to add a UpdateProgress to this. My question is where would I add the
code for it to work?

For example:

On the "GoogleMapForASPNet.ascx you have








Adding this below that I would expet to work but does not. Any idea?




Please wait, processing...

sudhakar T  - re: Problem with google API CultureInfo code |202.153.40.xxx |2009-10-27 06:07:28
my query is google API language Translate code Language Culture info code i am
searching but not showing how to do the language culture could u please send my
mail in that code in asp.net with C# language
Shabdar  - admin |198.96.180.xxx |2009-10-28 08:52:55
I did not understand your question properly. Can you explain what problem you
are facing without culture info?
Aqeel  - Map stopped displaying since yesterday (27-Oct-200 |203.81.199.xxx |2009-10-28 06:28:41
We are using this control in our application at the following url.

http://e2e1.e2e.cyso.net/office-locator-test/neder land-en.aspx

Until yesterday evening, it was working fine and today suddenly we noticed that
the map is not appearing anymore. The location markers are not appearing either.

You can see that Google logo and the link 'Terms of Use' are visible but the map
(including the panning and zooming control) is not there.

We had not made any changes to the code or the environment. We have also
confirmed that the google API key is correct and no error related to key is
returned by Google. We are using log4net to log all the API calls and there is
no record of any error returned by the API. All the geocoding calls are
returning the right response data XML as before.

Can you check what is happening here? Also if anyone else experienced a similar
issue these days? Please help!

Thanks
Aqeel
Shabdar  - admin |198.96.180.xxx |2009-10-28 08:51:06
Hi Aqeel

URL that you have mentioned throws 'Request timed out' error. Can you try
downloading source from here and see if its working?

There must be something changed on your page. Make sure that you have Height
property set properly,

GoogleMapForASPNet1.GoogleMapObject.Height = "600px";

Height is important. It must be a fix height in pixel, percentage height is not
supported by this control.
Aqeel  - We are using fixed height |203.81.199.xxx |2009-10-28 09:07:40
We are using fixed height ("660px")

I will see as to why the url is not responding.
James Solo  - Show status while updating map? |144.212.95.xxx |2009-10-28 10:42:22
Hello Shabdar,

Thanks so much for this awesome control. I have a question regarding how I can
show some some sort of progress indicator while the markers are being applied to
the map. I know this can be done via an Updateprogress within an Updatepanel
but I have not been able to get it to work. I tried creating a trigger for the
inputbutton btnFullScreen but nothing happens. I would be open to a javascript
solution as well. I just need to find a way to notify users that a map is
loading with markers. In some cases my process takes a few minutes depending on
the number of markers.

Thank you.
J
Shabdar  - admin |198.96.180.xxx |2009-10-28 12:15:33
You need to use custom javascript to display map update progress. Go to
GoogleMapAPIWrapper.js file and look for following functions,

fGetGoogleObjectOptimized()
fGetGoogleObject()

You can add custom javascript at the start of these functions to display
progress message.
James Solo  - reply |144.212.95.xxx |2009-10-28 13:00:09
Hello Shabdar,

Is there any way this can be done within an Updateprogress? I don't really know
any javascript.

Many thanks,
J
Shabdar  - admin |198.96.180.xxx |2009-10-29 12:26:19
It would be hard to implement with UpdateProgress. This is because although I
have used UpdatePanel, it doesn't render Google Map as a pure ASP.Net control.
It's all javascript behind the scene. So UpdateProgress wouldn't know if markers
are loading or already loaded.
Bjarni Mortense |80.196.69.xxx |2009-10-29 07:04:56
How can I configure the control to use Zoom-With-Mouse-Weel function?

/bjarni
Shabdar  - admin |198.96.180.xxx |2009-10-29 08:51:21
Unfortunately this control does not support Zoom-With-Mouse-Weel function. But
you can modify javascript file of this control to have this functionality.

Go to GoogleMapAPIWrapper.js file and look for function fGetGoogleObject(result,
userContext) function. Add following line at the start of this function.

map.enableScrollWheelZoom();

That should enable Zoom-With-Mouse-Wheel.
James Solo  - Internet Explorer 6 or 7? |144.212.95.xxx |2009-10-29 10:29:27
Hello,

Has anyone been able to get this to work in IE7? I have no problems in Firefox
v3.x. If you are able to get this to work in IE7, did you have to make any
changes, if so what?

Many thanks,
J
Shabdar  - admin |198.96.180.xxx |2009-10-29 11:36:23
It works in IE6 and IE7 both. I tested it. What kind of error do you get?

To see detailed error, you need to enable javascript debugging in Internet
Explorer. To do so, go to Internet Explorer Options->Advanced->Uncheck disable script debugging (Internet Explorer).
James Solo  - reply |144.212.95.xxx |2009-10-29 11:51:25
Hello Shabdar,

I get a 'Gmap2' is undefined error message.

Thanks for looking into this.

J
Shabdar  - admin |198.96.180.xxx |2009-10-29 12:20:50
'Gmap2' is undefined error message will appear if your internet is very slow or
not connected. Can you try opening http://maps.google.com site and see if it
shows google map?
James Solo |144.212.95.xxx |2009-10-29 13:32:54
Hello Shabdar,

I don't think it is my Internet connection as this works perfectly fine in
Firefox. Would having the control within a MultiView have any affect on this?
This is really weird as I have a machine with IE6 and it works but it doesn't
work on my colleague's machine who has the same exact version of IE6. IE
definitely doesn't work. Chrome and Firefox are all good.

Thanks,
J
James Solo |144.212.95.xxx |2009-10-29 13:59:32
I found this: http://google-maps-api2.blogspot.com/2009/07/re-gm
ap2-is-undefined-ie6-issue.html

Is there a way to clear the cache via a javascript function each time I load the
map?
Shabdar  - admin |198.96.180.xxx |2009-10-29 14:38:14
Hmm.. that's interesting. There is no way you can clear cache of client's
machine using javascript. This will allow hackers to get in to your computer.
But you can do it using HTML header code from server side. Visit following
articles, they have good explanation

http://support.microsoft.com/kb/222064/

http://www.codeguru.com/forum/showthread.php?t=...
Shabdar  - admin |198.96.180.xxx |2009-10-29 14:18:42
That's really strange. If it's happening on particular machine, then something
wrong with it. Check if you have some kind of javascript blocking software
installed. Or it could be some antivirus interfering with it.
Jonathan  - Marker Manager |161.149.63.xxx |2009-10-29 11:34:20
Is there any support for managing GooglePoint's the way the Google map Marker
Manager does? For example, I have 1000 points, but I want them to be grouped
into fewer icons when zoomed out. Likewise, is it possible to only load points
that are in the map's scope? For example, if I have a total of 1000 points,
but only 10 are in the map's view will the map perform as if there are only 10
points?

Thank you for the control!
James Solo |144.212.95.xxx |2009-10-29 11:52:16
I too would be VERY happy to see this functionality added.
Shabdar  - admin |198.96.180.xxx |2009-10-29 12:22:10
Ok, I will try to add this functionality in next release.
Jonathan |161.149.63.xxx |2009-11-05 18:36:10
Actually, I just read that the performance of MarkerManager is worse than
GMarkers:
http://www.svennerberg.com/2009/01/handling-lar.... If you do end up including marker management in the next release then
consider the results found here.

Thanks Again!
Jonathan
maxi  - This is nice |59.120.52.xxx |2009-11-04 21:21:31
You control is really nice.
But I need a lot customization to google map api.
I may need to launch my own map control.
do you have any article on how to make this control?
I have a book about 3inch thick which teach implementation of server control but
I really want to avoid reading it further... Thank you
girish  - What httphandler & httpModule to include?? |116.72.253.xxx |2009-11-10 09:41:41
Hi,

I am include System.Web.Extension of version 3.5.
What type of file i have to include in
with httphandler & httpModule section

Please Reply.....

Regards,
Girish
Girish  - Reminder : What httphandler & httpModule to includ |116.72.253.xxx |2009-11-11 00:39:08
Hi to All,

I am include System.Web.Extension of version 3.5.
What type of file i have to include in
with httphandler & httpModule section. It automatically creates that part in
web.config but somehow map not perform some function properly. such as zoomlevel
& recenter map. Please reply what is the problem.


Please Reply.....

Regards,
Girish[/quote]
Girish  - Can I use this google map control in production le |116.72.253.xxx |2009-11-12 02:10:09
Hi to All,

Great Control.
Can I use this control in release mode to use it on production level for showing
location on google map.

Is there is any need to change.

Regards,
Girish
Jamest  - Google Map not showing under hosted environment |41.213.126.xxx |2009-11-12 12:01:15
Hi, I have included the map control in my website development project. The map
shows up ok on my development machine but for some unknown reason shows up blank
(only Google llogo and terms show up) when the site is uploaded to a shared
hosting environment server where the site hosted by ISP 1 I have obtained a Maps
API key from Google for the site domain as http://info24seven.com, which should
work for any subdomain such as http://www.info24seven.com. Desperate for an
answer i uploaded the same site to another ISP 2's web host, using a different
domain and having obtained a separeta API key, and lo and behold the maps shows
up. It seems the problem lay with some setting under ISP1's hosting environment.
I have brought this to the attention of ISP1 support and they seem at a loss
tracking down the problem. I have subsequently removed my site content from ISP1
and uploaded the sample site available here for illustration and the problem
persists. See http://www.info24seven.com. Can you offer any hints to ISP1
support as to what they should check for that's causing the map control to fail?
Shabdar  - admin |198.96.180.xxx |2009-11-12 13:25:04
Hi Jamest

When I debug http://www.info24seven.com, it gives me 'GService is undefined
message'. This means webservice is not working from your ISP. I have used
webservice GService.asmx file to make Ajax calls in this control.

If you call http://www.info24seven.com/GService.asmx file on your website, it
should work. But it doesn't. This means your ISP is blocking web service calls.


Regards,
Shabdar
jamest  - Re: Googlemap not showing under hosted server |41.213.126.xxx |2009-11-22 15:52:06
Thanx for the advice. ISP1 failed to implement the recommendation so i'm
relocating the site to ISP2.



Much appreciated



Jamest
Pooja  - How to add scroll on pushpin? |122.163.149.xxx |2009-11-12 12:10:27
I want to know how to add scroll on the InfoHtml that is tooltip which pops out
when we click on pushpin
Girish Chaudhari  - Can not show the map for 4 digit value for latitud |116.72.253.xxx |2009-11-13 10:43:13
Hi to All

Our listner service gives us the latitude & longitude in 4 digit value. It shows
location point but blank map.

Google map shows successfully with latitude & longitude with 2 digit values.

Four digit value that I get 1830.3..= 18 degrees, 30.3 minutes .

How can I do to show the location with map with 4 digits value for latitude &
longitude?

Please reply .......

it's urgent.

Regards
Girish
Jim |82.141.234.xxx |2009-11-13 10:49:47
Hi Girish,

You will need to convert your minutes to decimal degrees.

Take 1830.3 = 18 + (30.3 / 60 ) = 18.505

1 degree = 60 minutes
1 minute = 60 seconds

Jim
Girish  - How to show direction with arrow from start to End |116.72.253.xxx |2009-11-14 02:53:23
Hi to All,

I have the packets record in my database. Which I showed on google map with
polyline,

I want to show the direction arrow between the points as on which vehicle goes
so that we will see the the polyline with arrowed direction.

How we can do this type of functionality???

If we can show the icon image of arrows, but how to decide direction which arrow
to show???

Please reply.......

Regards,
Girish
Girish  - Reminder : How to show direction with arrow from s |116.72.253.xxx |2009-11-14 05:07:52
Hi Shabdar,

I have the packets record in my database. Which I showed on google map with
polyline,

I want to show the direction arrow between the points as on which vehicle goes
so that we will see the the polyline with arrowed direction.

How we can do this type of functionality???

If we can show the icon image of arrows on the points, but how to decide
direction which direction arrow to show???

Is any other idea to implement this??

eg. my current database info gives me current top 20 record then first record is
current actual location. & need to draw polyline between the pointswith arrow
direction on which end point will be our current location.

Please reply.......

Regards,
Girish
Girish  -  How to integrate this function in javascript?? |116.72.253.xxx |2009-11-18 00:27:36
Hi to All,

I got the source for drawing the arrowIcon image on the polyline on site
http://www.econym.org.uk/gmap/example_arrows.htm

It contains following javascript :: WHICH WE CAN VIEW ON PAGE SOURCE.


////////////////////////////////////////////////// ////////////

I want to integrate functions in that javascript in our control's javascript
GoogleMapAPIWrapper.js so that we can draw the polyline with arrow head image.

I want to achieve directed polyline on google map.

Please reply me ho we can achive this. .................


Regards,
Girish
nextgen  - User control support for Mobile Application |115.108.97.xxx |2009-11-18 04:16:18
I have created a web application with this user control
But that website is not accessible in mobile device (map is not shown)
Is it anything i have missed

Anything additional i need to do?
Please suggest me
Shabdar  - admin |198.96.180.xxx |2009-11-18 09:44:29
Hi Nextgen

This user control does not support mobile device.

Shabdar
Girish  - How to show info Html open????? |116.72.253.xxx |2009-11-19 00:18:39
Hi to All,

I want to show info html of current point open when first time page loads. How
we can do this?????

I want to show driving information with location on infoHtml open by default
when first time the page opens.

Please reply .................

Regards,
Girish
Girish  - How to build our own user define |116.72.253.xxx |2009-11-19 05:48:54


Can we crate a user define custom base google map on which we can add our
predefine landmark points?

Now in application we access google map with original information. Our GPS
device returns location of current point with some description such as your
vehicle is .. distance away from some xxx location.

So can we build to some user define google map on which we can add custom
landmarks on google map, then we access that custom url to access google map.


Regards
Girish
Bjarni |80.196.69.xxx |2009-11-19 09:30:57
How can I call javascript-function "OpenInfoWindow()" from C#-code?

I want to change infoHtml and open the infowindow without any use-activity.

/bjarni
Girish  - re: How to show info Html open????? |116.72.253.xxx |2009-11-21 08:49:53
Its done now to show infohtml open by default when page loads But it opens for
the single point on the map eg., first point which is added to the map.

for this simply add following block in fGetGoogleObject method of
GoogleMapAPIWrapper.js file before "//Add polylines" block of stament.

if (result.Points[0])
{
OpenInfoWindow(result.Points[0].ID, result.Points[0].InfoHTML);
}

& the js file already have the function OpenInfoWindow.

In this code I did also try for the point which is last point of map by passing
index of point collection length. But that time infoHtml window opens for the
last point only & not for first point.

Can any one know that how to show 2 points infoHtml opens by default.
Or
can we show only one point infoHtml window open by default without user
activity? If so, Why?

Reply please....

Regards,
Girish
jon |75.227.9.xxx |2009-11-22 16:18:49
Bjarni Mortensen  - Poping infoWindow on demand |80.196.69.xxx |2009-11-25 08:52:00
Hi again,

I still can not see how I can pop an Info-Window for a specific map-point on
demand from C#-code.

ex.:
I get dynamic point-information from a database, which I want to pop in the
Info-Window When I get them from the database. I can move the Points, change
their icon - but I can not pop the Info-Window without user activity.

Please help.
Roger |71.5.61.xxx |2009-11-23 16:45:16
It works when I display 100-200 markers, but if I try to display 300 or more
markers all I get is a gray output with the Google logo

What am I doing wrong?
Roger |71.5.61.xxx |2009-11-23 17:45:35
I found a solution which is to increase your MaxJsoLength to its maximum value
in web.config.

system.web.extensions
scripting
webServices
jsonSerialization maxJsonLength="2147483644"
/jsonSerialization
/webServices
/scripting
/system.web.extensions
Girish  - re: Can not displaying markers above 135 ?? |116.72.253.xxx |2009-11-24 02:57:47
Hi roger I have same problem. I did the same as you suggest me. But it give me
error.

Unrecognized attribute 'maxJsonLength'. Note that attribute names are
case-sensitive. D:\ParallelMinds\Projects&
#92;SBTS\ParentModule\web.config

not have maxJsonLength property in section name="jsonSerialization" ? I
am using Version=3.5.0.0 for the System.Web.Extension.

Regards,
Girish

What to do? Where I have to place it?
Roger |71.5.61.xxx |2009-11-24 11:58:48
Google for maxJsonLength and you'll see some examples.
Girish  - Can not displaying markers above 135 ?? |116.72.253.xxx |2009-11-24 02:35:59
Hi to All
It works when I display 135 markers, but if I try to display 140 or more markers
all I get is a gray output with the Google logo. I had tries with Rogers answer
to set maxJsonLength in following block



but not contain the property maxJsonLength property.
What is wrong?? where I have to set the property??
Please reply ..

Regards
Girish
Girish  - re: Can not displaying markers above 135 ?? |116.72.253.xxx |2009-11-24 02:36:58
Girish wrote:
Hi to All
It works when I display 135 markers, but if I try to display 140 or more markers
all I get is a gray output with the Google logo. I had tries with Rogers answer
to set maxJsonLength in following block

section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSe rializationSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false"
allowDefinition="Everywhere"

but not contain the property maxJsonLength property.
What is wrong?? where I have to set the property??
Please reply ..

Regards
Girish
Girish  - re: Can not displaying markers above 135 ?? |116.72.253.xxx |2009-11-24 02:41:27
I have got the error Error

Unrecognized attribute 'maxJsonLength'. Note that attribute names are
case-sensitive. D:\ParallelMinds\Projects&
#92;SBTS\ParentModule\web.config

Please reply where to set maxJsonLength property.
Girish  - How to create class GoogleIntegrationManager ?? |116.72.253.xxx |2009-11-27 09:34:14
Hi to All,
I am develping the google map web application with the help of user control
(Google Map Control for asp.net). I have a aspx page on which I am using
google map control & creating various google point & polylines on code behind.

Now I want to write some class as googlemapIntegration in special class library
which contains method like
GooglePolyline getPolyline(listOfPoints)

which takes list of points & return polyline.
How we can write the class? How we can access GooglePoint, GooglePolyline, etc
class on class in class library.

Reply Please....
Regards,
Girish
scsalon  - How to do javascript sidebar with this control |67.97.229.xxx |2009-12-10 16:40:08
This control is fantastic and I have a good working model that does SQL calls
and stuffs the info coming back into the control variables. What I also want to
do is put in a list of the markers on the aspx page in one cell of a table, as a
sidebar. The idea, of course, would be to click the links on the sidebar and
have the icon marker selected. I see how I can get markers if I'm hard coding
them on the aspx with javascript, but of course i want to call the database
info-how do I get info for each item with the control and call them from the
main page?
viram mehta  - how to use client id for google map api premier |61.17.213.xxx |2009-12-14 07:45:51
I am premier user of Google MAP api (purchased google map api key for 200
vehicles) and I was given a Client Id.

How I can use client id insted of Google MAP API Key?

Please reply urgently as client is waiting for the same.





Please reply on

This email address is being protected from spambots. You need JavaScript enabled to view it.

or

This email address is being protected from spambots. You need JavaScript enabled to view it.



waiting for your reply.



viram mehta  - How to use google map API premier Client ID insted |61.17.213.xxx |2009-12-14 07:49:32
I am premier user of Google MAP api (purchased google map api key for 200
vehicles) and I was given a Client Id.

How I can use client id insted of Google MAP API Key in google map control for
asp.net?

Please reply urgently as client is waiting for the same.





Please reply on

This email address is being protected from spambots. You need JavaScript enabled to view it.

or

This email address is being protected from spambots. You need JavaScript enabled to view it.



waiting for your reply.



Shabdar  - admin |198.96.180.xxx |2009-12-14 09:43:40
Go to GoogleMapForASPNet.ascx file and look for following line

Code:

[script src="http://maps.google.com/maps?file=api&
v=&key=[%=GoogleMapObject.APIKey %]"
type="text/javascript"][/script]


Here I have given google map api key. You can modify this line to include client
key. I don't know how exactly you use it.
RK  - Google API version 3.0 |136.181.195.xxx |2009-12-15 15:37:56
Thanks for your code. It is working great.

When can you upgrde to Google map API version 3.0?

Thanks

RK
DB  - Google Street View |207.71.50.xxx |2009-12-16 12:06:04
Anybody know how to incorporate google street view into this control?
meenu  - Googlemap polyline with arrow. |82.178.39.xxx |2010-01-03 08:03:46
how to change polyline style ( ------) to (----> ) is it possible..?.pls help
me....



tc  - Setting up control |188.141.40.xxx |2010-01-31 19:37:42
Hi there,

I am having difficulty getting this to work. How do I add the control to a web
application rather than a website, I'm not sure how to get the ajax library
added as there is no add reference tab.

Also where in the web.config file is the new xml added.

Any help would be great, as you can see I'm not sure where to start.
Amir  - Where the heck My points are stored? |94.74.150.xxx |2010-02-02 10:57:36
i was just curious about where thos lat/lon points are going to store when page
is rendered ?! i cannot find any array/list..
chetna  - gps tracking |198.96.180.xxx |2010-02-26 05:25:51
oksi wrote:
Thank you for your article and great control.



Can you please provide an example of receiving Address if you know lat and
long?

Shabdar  - reverse geocoding |198.96.180.xxx |2010-02-26 05:25:22
Finding an address using latitude and longitude information is called reverse
geocoding. This control does not support reverse geocoding, but someone has
developed a javascript library using google maps api. Go to following link,

http://nicogoeminne.googlepages.com/documentati...
Raghu  - Earth |203.199.240.xxx |2010-03-01 07:19:36
HAI... I want mark 3 different directions in one particular point in map... i
dont know how to do this.....example( reference point id India... then i need to
mark from here to 3 different directions 21,180,320)....... please give some
ideas
jocy |217.33.197.xxx |2010-03-08 11:44:47
How would I use this in vb?
Robert |216.226.176.xxx |2010-03-08 13:17:55
I have converted Shabdar Ghata's code to vb.net and even included one example.
This was done with VS2008 in VB.net and using AJAX 3.5.



http://groups.google.com/group/google-maps-for-...



The name of the file is GoogleMaps_VS2008_with_AJAX35_(vbnet).zip



Hopefully, this will help a lot of you that are looking for a vb.net version.
Eirik R |195.204.175.xxx |2010-09-14 06:15:14
Hi Robert!
Where can I download the files? The link does not work.
Shabdar  - Admin |198.96.180.xxx |2010-09-14 09:50:58
Hi Robert,

Please send me your source files for VB.Net. I will upload it here on this site
so that other people can benefit from it.

Thanks
Shabdar
nano  - re: |190.104.4.xxx |2010-03-12 03:52:58
Bassem wrote:
never mind, figured it out :)
thanks


Hi Bassem, please explain your solution, thanks.
Meneer Aart  - 'GetGoogleObject'failed |93.174.200.xxx |2010-03-15 06:37:35
I am getting the following error message. I’m not always getting it and it seems
to happen a lot in IE.



The server method ‘GetGoogleObject’ failed with the following error: --

There was an error processing the request.



Does anyone have a resolution?



Thanks!

Maxx  - re: |196.210.140.xxx |2010-03-19 06:58:25
Martin Griffiths wrote:
HI,



Thanks played with you demo i downloaded, just come to move it over to my
project and getting compile error (The type or namespace name 'GoogleObject'
etc...) im using a web site application so App_Code is not there. how would I
convert this to work.



Thanks Again



Martin




I am getting the same error... any ideas out there ?
dennis  - 2 instances |78.133.11.xxx |2010-03-31 14:39:12
Is there any way to show 2 separate instances of the control on the same page?

Or any help in tweaking things to allow this?

Thanks
Serg  - re: how to measure distanse and Area? |72.198.218.xxx |2010-04-27 00:35:59
Has anyone find a way to calculate the distance between the two locations.

This value is actually being return in the route reponse.



Is there any way to modify the CS file to pull this value..
GivThanks  - Enquires according to longitude and lattitude |202.12.94.xxx |2010-05-11 00:32:41
I have an urgent problem, I will need to place an icon to move according to the
route. May I noe how to calculate the route and the longitude and lattitude. Pls
inform me immeditaely THANKS
zxgcqupt  - Problem |125.85.79.xxx |2010-05-14 23:52:16
I do as you say in the passage,but I get a problem It says can't find
googleobject !can you tell me how can i modify it !Thank you very much
yon86 |213.55.74.xxx |2010-05-15 02:32:46
first of all thanks for the great work u have saved me from a lot of work :) one
question I am having trouble removing specific pushpins on the map. e.g when I
assign IDs to my points i want to remove these points using the same ids but it
doesn't seem to work. help me
kirihara  - open popup from infoHTML? |124.106.45.xxx |2010-05-19 01:32:07
Hi, first of all i would like to say thanks for this wonderful control.

I have one question, is it possible to open a popup window from a text in a
Google Point's infoHTML (window.open(..))? for example, ill display the Marker's
information on its balloon using infoHTML right? then somewhere on that text, i
can click it and it will open a popup window.. i've tried many javascript codes
but none of them works, any help will be appreciated.. thanks.. ^^
Anonymous  - re: VB Version? |59.95.41.xxx |2010-05-26 03:49:50
I am having a problem with IE6,7 and 8. The control is unable to load. It shows
half of the map and when we press F11 key it displays the full map. why it is
so?? how do i need to resolve the same
KD  - SE |59.95.41.xxx |2010-05-26 03:51:02
I am having a problem with IE6,7 and 8. The control is unable to load. It shows
half of the map and when we press F11 key it displays the full map. why it is
so?? how do i need to resolve the same. It display map properly in mozila..plz
help me out..thnx in advance
Lars Karlsson  - Broken vb.net download link |173.164.189.xxx |2010-06-07 20:54:58
Robert-



The download link is broken - the file is missing



thanks

Lars









Robert wrote:
I have converted Shabdar Ghata's code to vb.net and even included one example.
This was done with VS2008 in VB.net and using AJAX 3.5.



http://groups.google.com/group/google-maps-for-...



The name of the file is GoogleMaps_VS2008_with_AJAX35_(vbnet).zip



Hopefully, this will help a lot of you that are looking for a vb.net version.
KiNGPiN  - Awesome work there but ....... |58.65.189.xxx |2010-06-08 01:53:29
Awesome work there man, but can you provide me any information or link to any
tutorial as to actually HOW to create a control ... thx :)
Istiaq Ahmed  - Problem with Google Map |69.172.16.xxx |2010-06-14 05:27:12
Hi, I used this control in my web application. Ran well on localhost; I obtained
valid api key from google and uploaded it on web server. Now the map doesn't
show up. no popup message is given, no error generated either. Only the map
portion is totally blank. I'm lost! Any suggestions?
Istiaq Ahmed |69.172.16.xxx |2010-06-14 06:20:07
also, i haven't placed it in update panel. There are other update panels in the
page, though. And the control is placed in a div, inside an ajax tab (there are
8 tabs in my page). Most importantly, it ran ok in my localhost. I need geocode
functionality and i would show up correctly in localhost. But after uploading to
server, it gives no error message, no exceptions and just shows blank. If my
address textbox is blank, it shows "Unable to geocode this address"
which means that code is running correctly. But there is no map. What might go
wrong? I'm just clueless
Istiaq Ahmed  - re: |69.172.16.xxx |2010-06-14 06:47:49
Ok, i resolved it. Thanks everybody
Arvinnth  - Map Didn't show |117.201.35.xxx |2010-06-20 06:41:22
Everything i done but The Map Diidn't show on the Web Page
kremilek10  - Polygon with tootltip or infoHTML |78.80.170.xxx |2010-06-25 02:08:31
How put to polygon infoHTML or Tooltip ?
visham  - to create a GPS system |115.132.51.xxx |2010-07-01 09:22:32
can this be used to represent gps data from a database,

that is latitude and logituded data from every 30seconds.

how can this be done useing this control?
vijay  - Google map Rotating |123.176.39.xxx |2010-07-06 02:18:04
hi,



how do i rotate the google map control.(45 degrees).





please help.



regards

vijay
gauravipec  - Center point |122.162.161.xxx |2010-07-09 01:40:29
Thank you for your article and great control


i want my first latitude longitude value as center point value
gauravipec  - Zoom level automatic |122.162.161.xxx |2010-07-09 01:43:15
Thank you for your article and great control


I want zoom level automatic..
subbu  - driving direction |122.164.154.xxx |2010-07-14 04:40:15
Hai,



in google map i want to get the driving direction between two points, in this
instead of passing address want to give lat\long.



Antonio  - API Version 3 |89.119.94.xxx |2010-08-05 04:15:57
Hi,
first of all I want to thank you for the great job you've made.

Do you plan to build another version using GOOGLE API VERSION 3?
I'm not so familiar with JavaScript and the only thing I was able to do, was
Geocoding using the new API.

Regards
Antonio
S.Arvinth  - error comming |117.201.33.xxx |2010-08-05 06:00:20
Error 3 The name 'hidEventName' does not exist in the current context

Error 4 The name 'hidEventName' does not exist in the current context

Error 5 The name 'hidEventValue' does not exist in the current context
iceboy  - HiddenField erro |187.17.0.xxx |2010-08-18 13:46:52
i'm facing the same problem in my code-behind:
"The name 'hidEventName' does not exist in the current context"

The intellisense finds the object but the buld fails.

any ideais??

PS: congratulations for the component, its really great!! :)
iceboy  - Solved! |187.17.0.xxx |2010-08-19 12:47:20
recreated the page with different name and exclude the other with error.

Problem Solved!
Okesh  - Great Work |84.92.230.xxx |2010-08-11 05:31:34
Thanks for your effort to put things in one place.



Regards



Okesh
Juanjo  - mr |190.249.17.xxx |2010-08-30 20:54:55
Great work



I have a question. how I can determine if a point is inside or outside of a
polygon?



Thanks



Juan Jose
xeeman  - pushpin Direction |213.249.249.xxx |2010-09-06 10:27:07
Just wonder if there is any way to see the Directions and other Options, while
clicking on a Pushpin?. At the moment its only the html Info supplied to the
map point.
Eirik R  - re: |195.204.175.xxx |2010-09-14 06:13:10
Hi Robert!
Where can I download the files? The link does not work.
Tharanga  - How to open this |112.135.5.xxx |2010-09-21 22:24:03
sorry.. i'm new to this..
may i know how to open this. this file did not contain solution file..
plz help me
Swapnil |124.247.232.xxx |2010-10-06 06:16:22
G Maps V3 version..???????
sujit paramanik  - Thanks for great control |113.19.81.xxx |2010-10-18 00:42:09
Thanks for such a good contro
1.how can get permanent API for google?
2.how can i use reverse geocoding?
3.if use is there evalution period for this control if yes how can i purchase
it.
sudheesh  - gmap in 2010 |122.166.96.xxx |2010-12-02 03:52:02
Sir

try to gmap add controls to in my project but found some errors on hidEventname
not accessing
hidEventValue not accessing
that type of error
Supriya Chakraborty  - Need help on reverse geocoding |59.93.196.xxx |2010-12-11 11:42:23
Is it possible to put reverse geocoding on map and marker click?
Pradeep  - openinfowindow On pageload |220.224.228.xxx |2010-12-15 05:46:28
Hai
which line we want to add for
display openinfowindow when we click a button



GooglePoint GP = new GooglePoint();
GP.Address = txtAddress.Text;
//GeocodeAddress() function will geocode address and set Latitude and Longitude
of GP(GooglePoint) to it's respected value.
if (GP.GeocodeAddress(txtAPIKey.Text))
{
//Once GP is geocoded, you can add it to google map.
GP.InfoHTML = GP.Address;
//Set GP as center point.
GoogleMapForASPNet1.GoogleMapObject.CenterPoint = GP;
GP.ID = "1";
//Clear any existing
GoogleMapForASPNet1.GoogleMapObject.Points.Clear() ;
//Add geocoded GP to GoogleMapObject
GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP) ;
GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 15;
GoogleMapForASPNet1.GoogleMapObject.ShowDirections = true;

Thanks
Pradeep
Shabdar |198.96.180.xxx |2011-03-21 11:35:21
Open Info Window when we click asp.net button or control is not supported right
now. I will try to include this feature in new version.
Ashraf Tammam  - Eng. |41.32.28.xxx |2010-12-15 09:34:01
Hello sir,



thanks for ur published control for google map. i am using it siince a long
time. i have a problem and i hope that u can help me.



the problem is that i want to embed this code:

http://gmaps-utility-library.googlecode.com/svn/tr
unk/snaptoroute/1.0/examples/demonstration.html



into ur control.



so that, i can select one of the drawing polylines (by its index) and snap to
it



can u help me doing that?????

what should i do to achieve my goal?????



regards,

ashraf
sudheesh  - poliline |122.166.96.xxx |2010-12-22 04:23:59
we have some lat and lng data in our database how to drow a poliline using this
control



GooglePolyline PL1 = new GooglePolyline();
PL1.ID = "PL1";
//Give Hex code for line color
PL1.ColorCode = "#0000FF";
//Specify width for line
PL1.Width = 5;


// PL1.Points.Add(GP2);
// PL1.Points.Add(GP3);
// GooglePoint GP1;
dt.Clear();
dt = objpers.ExecuteQuery("select * from msglog where va = 'A' and tmnl_id =
'CW0000T00000210' order by in_date,in_time");
int i = 1;

GooglePoints objpoins = new GooglePoints();
foreach (DataRow dr in dt.Rows)
{
GooglePoint objpnts = new GooglePoint();
objpnts = new GooglePoint();
objpnts.ID = i.ToString();
objpnts.Latitude = Convert.ToDouble(dr["lat"]);
objpnts.Longitude = Convert.ToDouble(dr["lng"]);
GoogleMapForASPNet1.GoogleMapObject.Points.Add(obj pnts);
PL1.Points.Add(objpnts);

//objpoins.Add(objpnts);
i++;
}
GoogleMapForASPNet1.GoogleMapObject.Polylines.Add( PL1);



pls give me solution for that
Shabdar |198.96.180.xxx |2011-03-21 11:33:21
Your example above should work fine as per my understanding. What's the issue
are you facing?
Sudheesh  - Google Api |122.166.96.xxx |2010-12-22 07:00:57
Sir

am using Google maps control in our site for some vehicle processing so we plan
to upgrade the gmap Api how can i update the api....... pls help me
Shabdar |198.96.180.xxx |2011-03-21 11:29:32
Hi Sudheesh

This is easy, just set following property with latest version. However some
functions may be broken in new version if google has changed existing API
function names etc. You should test control before using new version,

GoogleMapForASPNet1.GoogleMapObject.APIVersion = "3";
Khaled |41.32.24.xxx |2010-12-27 04:31:08
Hi Mr.Shabdar,Thanks for this great work,i really liked it too much.

I got a small question,,when a user navigates and put a pushpin on a location
and zoom in to a point,i want to save the lat and long and the zoom level of
that point.

it is possible to get the lat and long but the zoom level is always set to the
default zoom level.When i try to do the following it gets the default zoom level

GoogleMap1.GoogleMapObject.ZoomLevel

How can i get the final zoom level which the user selected
Khaled |41.32.24.xxx |2010-12-27 07:13:36
I found a solution and here is what i have done.

in GoogleMapAPIWrapper.js file in CreateMarker function i added a new parameter
for the zoom level to the GEvent.addListener() method and passed its value as
the following map.getZoom()

then in the GService.cs file i added a new parameter to the SetLatLon and passed
teh zoomlevel value to the GoogleObject

the method became as following

[WebMethod(EnableSession = true)]
public void SetLatLon(string pID, double pLatitude, double pLongitude,int
ZoomLevel)
{
GoogleObject objGoogleNew = (GoogleObject)System.Web.HttpContext.Current.Sessi
on["GOOGLE_MAP_OBJECT"];
GoogleObject objGoogleOld = (GoogleObject)System.Web.HttpContext.Current.Sessi
on["GOOGLE_MAP_OBJECT_OLD"];
objGoogleNew.Points[pID].Latitude = pLatitude;
objGoogleNew.Points[pID].Longitude = pLongitude;
objGoogleOld.Points[pID].Latitude = pLatitude;
objGoogleOld.Points[pID].Longitude = pLongitude;
objGoogleNew.ZoomLevel = ZoomLevel;
objGoogleOld.ZoomLevel = ZoomLevel;
}
Shabdar |198.96.180.xxx |2011-03-21 11:26:23
Hi Khaled
Glad that you found solution. Latitude and Longitude are always refreshed with
latest positions when you drag a pushpin. So that's not an issue. But zoom level
is not refreshed. I will fix that in new version.
Kourosh  - Dirrection issues |72.211.221.xxx |2011-02-02 18:42:01
Hi, Great Control. Thanks a lot for for the hard work.



Here are a couple of issues I ran into. I have a work around for one, but not
the other.



1. maps loads showing africa, then loads the directions.

After spending lots of time reading around about this, I found out that using:

GoogleMapForASPNet1.GoogleMapObject.CenterPoint = new GooglePoint("1",
-117.9248930, 33.7137300);

shows nothing before loading the directions. So, that didn't fix it, but at
least we don't see africa.

2. when I first load the map, I just want to show the destination without
dirrections.

I don't want to use a second map to use the control, so what I do is select the
same destination and start address. THe problem with this is that I get the map
zoomed in to the destination, and that's all I see on the map.

I tried setting:

GoogleMapForASPNet1.GoogleMapObject.AutomaticBound aryAndZoom=false;

GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 10; (or any other number)

but nothing changed.



If anyone has a fix or an idea for this, that would be awesome.



Shabdar |198.96.180.xxx |2011-03-21 11:22:45
Hi Kourosh

All you need to do is add pushpins to the map as you would do with ASP.Net code
and then set GoogleMapForASPNet1.GoogleMapObject.AutomaticBound aryAndZoom =
true. There was an issue with this property in previous versions. So download
new version and use it. For more clarification check MapWithDirections.aspx
example in new version, it shows both start and end positions along with route.
Shekh Fahimuddin  - Software Engineer |122.180.71.xxx |2011-03-15 05:15:58
Hi,
First of all a very thnx to you for this code. i am facing one problem every
thing is working fine except one thing whenever i call function in timer to fill
the latitude and longitude the map get refreshed. i dont want to refresh the map
whenever any new location has been added.

Please help me.

Thanks
Shabdar |198.96.180.xxx |2011-03-21 11:18:06
When you say map refreshes, do you mean page is posting back to server? If so,
you need to place timer control inside update panel.

If page is not posting back, and you see a flicker like it's removing and adding
all pushpin again, then yes that is correct. This is how it is designed. On
every postback like button click inside update panel, map will remove all
pushpins and re-add them. But it does not mean it's recreating map from scratch.
It still uses same map that was created during first page load.
Meenu  - Geofence using this code |85.154.175.xxx |2011-03-15 07:45:07
dear friend

i did googlemap using the link below long back.

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

now i want to add the geofence feature in this ?How can i do that?My requirement
is i want to add polygons or route inside the map and need to save these regions
in database.

Whenever the vehicle inside this polygons value in the database i need to
generate reports?

how can i do this? can anybdy help me?
Shabdar  - re: Geofence using this code |198.96.180.xxx |2011-03-21 11:09:19
Hi Meenu
You can achieve this. Download latest version 1.7 and check
GoogleMapAPIWrapper.js file. Look for function AreMarkersWithinMapBounds(). In this function I am checking if all markers are within Map area. If they are
outside I recenter map and change zoom level to accomodate all pushpins. You
need to write similar function that will check if a specific pushpin is within a
polygon region.
Shabdar |198.96.180.xxx |2011-03-21 07:13:19
Hi Meenu



Ignore my previous post. This is easier than I thought. There is directly a
function available to check if a point is inside a polygon in google map api.
See below example



var coordinate = new google.maps.LatLng(40, -90);

var isWithinPolygon = polygon.containsLatLng(coordinate);

kim  - re: Admin |122.177.216.xxx |2011-04-01 06:09:52
sir thanks very much
application is excelent


thanks a lot

god bless u
Salman Baig  - Need to Fix GetHTTPURL and GetLocalPath in cGoogle |110.93.205.xxx |2011-04-06 01:23:28
Nice effort but you need to change GetHTTPURL and GetLocalPath in cGoogleMap.cs
as they crash out in case we specify some iamge imageicon and pass some argument
as querystring. I have fixed at my local you may do in your version.

public static string GetHttpURL()
{
string str = System.Web.HttpContext.Current.Request.Url.Absolut eUri;
if (str.Contains("?"))
{
str = str.Split(new char[] { '?' })[0];
}


string[] s = str.Split(new char[] { '/' })< s.Length - 1; i++)
{
path = path + s[i] + "/";
}
return path;
}

public static string GetLocalPath()
{
string str = System.Web.HttpContext.Current.Request.Url.Absolut eUri;

if (str.Contains("?"))
{
str = str.Split(new char[] {'?'})[0];
}

string[] s = str.Split(new char[] { '/' });
< s.Length - 1; i++)
{
path = path + s[i] + "\\";
}
return path;
} string PageName = s[s.Length - 1];
s = System.Web.HttpContext.Current.Request.MapPath(PageName).Split(new char[] { '\\' });
string path = s[0] + "\\";
for (int i = 1; i > string path = s[0] + "/";
for (int i = 1; i >
Salman Baig  - re: Need to Fix GetHTTPURL and GetLocalPath in cGo |110.93.205.xxx |2011-04-06 01:25:29
[quote=Salman Baig]Nice effort but you need to change GetHTTPURL and
GetLocalPath in cGoogleMap.cs as they crash out in case we specify some iamge
imageicon and pass some argument as querystring. I have fixed at my local you
may do in your version.

public static string GetHttpURL()
{
string str = System.Web.HttpContext.Current.Request.Url.Absolut eUri;
if (str.Contains("?"))
{
str = str.Split(new char[] { '?' })[0];
}

string[] s = str.Split(new char[] { '/' });
string path = s[0] + "/";
for (int i = 1; i < s.Length - 1; i++)
{
path = path + s[i] + "/";
}
return path;
}

public static string GetLocalPath()
{
string str = System.Web.HttpContext.Current.Request.Url.Absolut eUri;
if (str.Contains("?"))
{
str = str.Split(new char[] {'?'})[0];
}

string[] s = str.Split(new char[] { '/' });
string PageName = s[s.Length - 1];
s = System.Web.HttpContext.Current.Request.MapPath(Pag eName).Split(new char[] {
'\\' });
string path = s[0] + "\\";
for (int i = 1; i < s.Length - 1; i++)
{
path = path + s[i] + "\\";
}
return path;
}

Some how it destroyed my code in last message. So posting it again


Posted: 2 months 3 weeks ago by tardeh #466
tardeh's Avatar
Help!

I am trying to use the Google Maps control but the moment I drag it onto my page and build my application, i get errors. something like "The namespace Google object could not be found. Are you missing a using directive?"

I am running VS 2010
Posted: 5 months 1 week ago by huynhle3005 #465
huynhle3005's Avatar
Ghorbani wrote:
Hi,
I create project with your grate control
i have Ques :
is there any limitation in number of points in polyline because i cannot drow polyline with more than 291 ?
my sample code is

for (int i = 0; i < dt2.Rows.Count; i++)

{

GooglePoint GP = new GooglePoint();
GP.ID = "GP" + i.ToString();
GP.Latitude = double.Parse(dt2.Rows[3].ToString());
GP.Longitude = double.Parse(dt2.Rows[2].ToString());

//LastPoint_Longitude = double.Parse(dt2.Rows[2].ToString());

//LastPoint_Latitude = double.Parse(dt2.Rows[3].ToString());

PL1.Points.Add(GP);


}

when my dt2.Rows.Count is more than 291 nothing will not drow
please help
thank you

==========
The maximum number is 279 marker. Why?
Posted: 5 months 3 weeks ago by Nambukarthy Raveendran #464
Nambukarthy Raveendran's Avatar
Hi Shabdar,

I have created the directions between multiple points but i have to delete the directions when i click the button which is in update panel, so can u tell me how to do that?
Posted: 6 months 1 week ago by Nambukarthy Raveendran #461
Nambukarthy Raveendran's Avatar
Hello bro, can u explain how to create direction between multiple lat and lng instead of giving multiple address
Posted: 6 months 2 weeks ago by pranali #460
pranali's Avatar
Did you got any solution then please share with I ....I am also facing same problem
Posted: 6 months 3 weeks ago by Ghorbani #457
Ghorbani's Avatar
Hi,
I create project with your grate control
i have Ques :
is there any limitation in number of points in polyline because i cannot drow polyline with more than 291 ?
my sample code is

for (int i = 0; i < dt2.Rows.Count; i++)

{

GooglePoint GP = new GooglePoint();
GP.ID = "GP" + i.ToString();
GP.Latitude = double.Parse(dt2.Rows[3].ToString());
GP.Longitude = double.Parse(dt2.Rows[2].ToString());

//LastPoint_Longitude = double.Parse(dt2.Rows[2].ToString());

//LastPoint_Latitude = double.Parse(dt2.Rows[3].ToString());

PL1.Points.Add(GP);


}

when my dt2.Rows.Count is more than 291 nothing will not drow
please help
thank you
Posted: 7 months 1 week ago by Radders #456
Radders's Avatar
Hi,

I have downloaded your code, and created a new project in VS 2012 and added all the files from the ZIP.

However, it will not compile and gives these errors:

Type 'Samples_SimpleMapWithMovingPushPins' already defines a member called 'Page_Load' with the same parameter types
Type 'MapWithAutoMovingPushpins' already defines a member called 'Timer1_Tick' with the same parameter types
Type 'MapWithAutoMovingPushpins' already defines a member called 'Page_Load' with the same parameter types
The type or namespace name 'GoogleObject' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'GoogleObject' could not be found (are you missing a using directive or an assembly reference?)

Please advise what I should do. Thanks
Posted: 7 months 2 weeks ago by jeetendra72 #455
jeetendra72's Avatar
hi

Lately my google maps web app developed with API 1.7 in ASP.NET was working ok and suddenly it has stopped working and no data/push pin can be seen.

I upgraded the API to 1.92, using ASP.NET under 4.5 framework on VS2012. still it does not work.

I have tried to create a new project with API 1.92 but all in vain

can anybody assist us asap us.
Posted: 7 months 2 weeks ago by engineer #453
engineer's Avatar
why maps like this when i run. have 2 maps. any solution.
Posted: 7 months 4 weeks ago by vijayakanthap #452
vijayakanthap's Avatar
Hi how to capture the date from google traffic layer?

Also need help on getting the road information from code?
Posted: 8 months 1 week ago by dnorris #449
dnorris's Avatar
I want to automatically display the infohtml when the map loads. How can I accomplish this?

The infohtml is already defined for a GooglePoint.
Posted: 8 months 2 weeks ago by ccerdaz #448
ccerdaz's Avatar
Dear friend, thank you for this control. I have some trouble when I open two or more pages with maps. In this case, the markers, polylines and poligons are cloned in all pages. May be because they are using the same groups of files and the same user session. Can you show me how avoid this situation?
Posted: 10 months 6 days ago by shabdar #443
shabdar's Avatar
Hi,
Version 1.9.2 is released. Download latest.
Shaikh wrote:
Hi Shabdar,

When will be the new version(1.9.2) is coming, I am still facing the IconImageHeight and IconImageWidth problem.

Thanks & Regards
Shehbaz Shaikh
Posted: 10 months 6 days ago by Shaikh #442
Shaikh's Avatar
Hi Shabdar,

When will be the new version(1.9.2) is coming, I am still facing the IconImageHeight and IconImageWidth problem.

Thanks & Regards
Shehbaz Shaikh
Posted: 10 months 2 weeks ago by rohin2sharma #438
rohin2sharma's Avatar
Hi Shabdar...

i need to integrate the google map in our website to track vehicle using GPS in c# or javascript.
Following things i need to show it on our websites as client required...

1. Source and Destination.
2. Best suggestive route.
3. traffic overlays.
4. total distance.
5. current vehicle location changes and move vehicle according to time

Can you please provide me the code in which all things to be integrated by you.

please its very urgent to show to client asap.

i'm very thankful to you if you provide me the code along with all the things as i mentioned above.


Regards
Rohin
Posted: 11 months 1 week ago by Imran-Khan #435
Imran-Khan's Avatar
The InfoHTML box appears with a mouse click; custom tooltips pop up instantly on mouseovers and make use of css. Regarding a custom tooltip, my Google v. 2 code included this inside your CreateMarker function:


GEvent.addListener(marker,"mouseover", function()
{
showTooltip(marker);
});
GEvent.addListener(marker,"mouseout", function()
{
tooltip.style.visibility="hidden";
});

function showTooltip(marker)
{
tooltip.innerHTML = marker.tooltip;
var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds ().getSouthWest(),map.getZoom());
var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
var anchor=marker.getIcon().iconAnchor;
var width=marker.getIcon().iconSize.width;
var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y + anchor.y));
pos.apply(tooltip);
tooltip.style.visibility="visible";
}

Then in the map.aspx file I had this:
<style type="text/css">
.tooltip {
font-family: verdana;
font-size: 11px;
background-color: #ffffff;
padding: 2px 2px 2px 2px;
border: 1px #006699 solid;
max-width: 158px;
}
</style>

In version 3, there is no longer getCurrentMapType().getProjection()

Thanks!
Posted: 11 months 1 week ago by shabdar #434
shabdar's Avatar
Imran-Khan wrote:
Thank you Shabdar for your timely 1.9.1 update! Shabash! Geocoding now works with Google Maps 3.0

One more question: Is there a way to make a custom tooltip using your control? I had something working for Google Maps 2.0, but Google's 3.0 documentation shows I now need to use the Maps Overlay class. Any ideas on how I can make this work using your control?

Hi Imran,
Are you talking about custom info window? You can achieve it by providing custom HTML in InfoHTML property of GooglePoint. If not then show me some online example on what you are trying to do?
Posted: 11 months 1 week ago by Imran-Khan #433
Imran-Khan's Avatar
Thank you Shabdar for your timely 1.9.1 update! Shabash! Geocoding now works with Google Maps 3.0

One more question: Is there a way to make a custom tooltip using your control? I had something working for Google Maps 2.0, but Google's 3.0 documentation shows I now need to use the Maps Overlay class. Any ideas on how I can make this work using your control?
Posted: 11 months 2 weeks ago by shabdar #430
shabdar's Avatar
Hi Shaikh,
Thanks for reporting this issue. I will address this issue in upcoming release 1.9.2.

Regards,
Shabdar
Shaikh wrote:
Dear Sir,

IconImageHeight and IconImageWidth property of GooglePoint is not working In Google Map API V 3 code.
Can we set the height and width of Icon image while Creating GooglePoint ?



Thanks & Regards
Shehbaz Shaikh
Posted: 11 months 2 weeks ago by Shaikh #429
Shaikh's Avatar
Dear Sir,

IconImageHeight and IconImageWidth property of GooglePoint is not working In Google Map API V 3 code.
Can we set the height and width of Icon image while Creating GooglePoint ?



Thanks & Regards
Shehbaz Shaikh
Posted: 11 months 2 weeks ago by shabdar #427
shabdar's Avatar
Hi Nitin,
Sorry for late reply. When I see webservice URL you have mentioned, I can see properties like PointStatus, LineStatus etc. Those ones I just use internally in control to restore state of Google Map. Is that what you are talking about?

Thanks
Shabdar
Posted: 11 months 2 weeks ago by shabdar #426
shabdar's Avatar
Hi Imran,
Geocoding is now fixed with version 1.9.1. Download latest version. Thanks for reporting.

Regards,
Shabdar
Imran-Khan wrote:
Hello Shabdar,

I've been using your.Net control, which utilizes the Google API v2, for sometime, thank you! Unfortunately Google has deprecated their v2 Google Maps API, and added v3, breaking my implementation of your map control. So I downloaded your version 1.9 control hoping to resolve the error, but I still get a 403 message from Google when geocoding addresses. I don't think you have upgraded your control to handle Google's new geocoding functionality. Will you be planning to do this soon? I have been using Bing Map's API for another project, which works well, but would rather stay with your ASP.Net mapping control if possible if there's a timely upgrade to v3.

Thank you again!
Douglas
Posted: 11 months 3 weeks ago by izaurek #425
izaurek's Avatar
Hi

Check my version based on Shabdar's control

http://www.shabdar.org/media/kunena/attachments/926/google_maps.zip

Now it's possible to calculate zoom for addresses :)
Posted: 11 months 4 weeks ago by Imran-Khan #424
Imran-Khan's Avatar
Hello Shabdar,

I've been using your.Net control, which utilizes the Google API v2, for sometime, thank you! Unfortunately Google has deprecated their v2 Google Maps API, and added v3, breaking my implementation of your map control. So I downloaded your version 1.9 control hoping to resolve the error, but I still get a 403 message from Google when geocoding addresses. I don't think you have upgraded your control to handle Google's new geocoding functionality. Will you be planning to do this soon? I have been using Bing Map's API for another project, which works well, but would rather stay with your ASP.Net mapping control if possible if there's a timely upgrade to v3.

Thank you again!
Douglas
Posted: 1 year 6 days ago by nitin #422
nitin's Avatar
Hi Aascroft,

please download API V3 files from here:

http://shabdar.org/downloads/GoogleMapControl%20v1.9.zip