locked
Google Map RRS feed

  • Question

  • User1876077155 posted

              string sStreetAddress = "";
            string sMapKey = Convert.ToString(ConfigurationManager.AppSettings["googlemaps.subgurim.net"]);


            //Subgurim.Controles.GeoCode GeoCode = default(Subgurim.Controles.GeoCode);
            Subgurim.Controles.GeoCode GeoCode;

            sStreetAddress = "India";
            GeoCode = GMap1.geoCodeRequest(sStreetAddress, sMapKey);

            Subgurim.Controles.GLatLng gLatLng = new Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat,                                 GeoCode.Placemark.coordinates.lng);

            GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal);
            Subgurim.Controles.GMarker oMarker = new Subgurim.Controles.GMarker(gLatLng);
            GMap1.addGMarker(oMarker);



    this is my code and i found a error i cant resolve it...

    Static member 'Subgurim.Controles.GMap.geoCodeRequest(string, string)'
    cannot be accessed with an instance reference; qualify it with a type name instead  

    Friday, January 1, 2010 8:52 AM

All replies

  • User-1659704165 posted

    Hi,


    string sStreetAddress = null;
      string sMapKey = ConfigurationManager.AppSettings("googlemaps.subgurim.net");
         Subgurim.Controles.GeoCode GeoCode = default(Subgurim.Controles.GeoCode);
         
         sStreetAddress = "Avinash Tiwari Kandivali Mumbai India ";
         GeoCode = GMap1.geoCodeRequest(sStreetAddress, sMapKey);
         Subgurim.Controles.GLatLng gLatLng = new Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng);
         
         GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal);
         Subgurim.Controles.GMarker oMarker = new Subgurim.Controles.GMarker(gLatLng);
        GMap1.addGMarker(oMarker)


    OR

    http://gathadams.com/2007/08/21/add-google-maps-to-your-net-site-in-10-minutes/

    how to acess google Map Chk the above link

    Friday, January 1, 2010 12:47 PM
  • User-635215137 posted

    Hi:

    Replace: GeoCode = GMap1.geoCodeRequest(sStreetAddress, sMapKey);

    To: GeoCode = Subgurim.Controles.GMap.geoCodeRequest(sStreetAddress, sMapKey);

    See the working code here: http://www.datawebcoder.com/codeByLanguage/1103/Asp_net_google_map_geoCodeRequest_error.aspx

    Cheers

    Saturday, November 6, 2010 3:51 AM