Help us translate this website and improve this translation and earn free licenses!
Anonymous user  |  Log in  |  Create Account

GeoCoding

What is the GeoCoding? With GeoCoding we can look for a site (for example "the Sales, Madrid", "Gibraltar" or "Polytechnical University of Valencia") and GoogleMaps.Subgurim.NET will bring one to that selected location... an example is worth more than a thousand words!
To use GeoCoding, we'll use the class with that same name: GeoCoding. The class GeoCoding has 5 properties with which we can customize the result:
  • Show: a enumerator with which to choose the event that will take place when searching for a location. It is made up of three elements:
    • infowindow: shows an infoWindow with the complete direction in text. It's the default.
    • icon: simply shows an icon in the searched location.
    • mapBlowUp: shows a mapBlowUp, which is, as you know, a zoomed in place in a window.
  • openedOnLoad: applicable if we chose to show an infoWindow or a mapBlowUp. It indicates if the window will be opened by default or if we will have to press an icon to open it. By default it is true.
  • errorText: the message that will appear in an alert window if it can't find what it's looking for. It's default value is ":(".
  • infoText: the previous text in the text box. HTML can be included. By default it is "GeoCode".
  • buttonText: the text of the button. by default "OK".
  • viewport: using GLatLngBounds sets the relevant area where we want to see the results.
  • baseCountryCode: setting the country code we will see the results near it.
  • showErrorCode: if activated the code error will be shown if an error happens. Here is the code error explanation: http://code.google.com/apis/maps/documentation/reference.html#GGeoStatusCode


Buscar GeoCode:


Code.aspx
<cc1:GMap ID="GMap1" runat="server" />
Code.aspx.cs
/* Con esto bastaría para que funcionara!!!
GMap1.addGeoCode(new GeoCoding());
*/

GMap1.GZoom = 9;
GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl));

GeoCoding geoCoding = new GeoCoding();

geoCoding.show = GeoCoding.ShowEnum.infowindow;
geoCoding.openedOnLoad = true;
geoCoding.errorText = "No tá";
geoCoding.buttonText = "Buscar";
geoCoding.infoText = "Buscar GeoCode";

GMap1.addGeoCode(geoCoding);
Powered by Subgurim.NET