GoogleMap
Namespace: Wisej.Web.Ext.GoogleMaps
Assembly: Wisej.Web.Ext.GoogleMaps
Represent an instance of the Google Maps widget.
- C#
- VB.NET
public class GoogleMap : Widget
Public Class GoogleMap
Inherits Widget
Constructors
GoogleMap()
Constructs a new GoogleMap control.
Properties
ApiKey
String: Returns or sets the Google Maps API key.
GoogleMapsURL
String: Returns or sets the default location of the Google Maps library. The default is //maps.googleapis.com/maps/api/js
You can assign this value directly or set it under the application keys using the key name "GoogleMaps.URL". It cannot be changed or assigned after the component has been loaded the first time.
InitScript
String: Overridden to create our initialization script.
Libraries
String: Gets or sets the Google Maps libraries to load. See: libraries.
Options
Object: Returns or sets the specified MapOptions: reference#MapOptions
Packages
List<Package>: Overridden to return our list of script resources.
Version
String: The Google Maps version to load.
See: versions.
Methods
AddMarker(markerId, lat, lng, options, center)
Adds a new marker to the map.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The unique ID that identifies the marker. |
| lat | Double | The latitude of the marker. |
| lng | Double | The longitude of the marker. |
| options | Object | An optional dynamic object that specifies the marker options: reference#MarkerOptions. |
| center | Boolean | True to center the map after setting the marker. |
AddMarker(markerId, location, options, center)
Adds a new marker to the map.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The unique ID that identifies the marker. |
| location | LatLng | An instance of LatLng than identifies the location of the marker. |
| options | Object | An optional dynamic object that specifies the marker options: reference#MarkerOptions. |
| center | Boolean | True to center the map after setting the marker. |
AddMarker(markerId, address, options, center)
Adds a new marker to the map.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The unique ID that identifies the marker. |
| address | String | The address - to be geocoded - of the marker. |
| options | Object | An optional dynamic object that specifies the marker options: reference#MarkerOptions. |
| center | Boolean | True to center the map after setting the marker. |
AddRoute(origin, destination, travelMode)
Uses GoogleMaps DirectionService to route and display a path between the origin and destination. See directions.
| Parameter | Type | Description |
|---|---|---|
| origin | LatLng | The latitude and longitude of the origin. |
| destination | LatLng | The latitude and longitude of the destination. |
| travelMode | TravelMode | The type of routing requested. |
AddRoute(origin, destination, travelMode)
Uses GoogleMaps DirectionService to route and display a path between the origin and destination. See directions.
| Parameter | Type | Description |
|---|---|---|
| origin | String | The name of the origin. |
| destination | String | The name of the destination. |
| travelMode | TravelMode | The type of routing requested. |
CenterMap(lat, lng)
Centers the map at the specified location.
| Parameter | Type | Description |
|---|---|---|
| lat | Double | The latitude of the center of the map. |
| lng | Double | The longitude of the center of the map. |
CenterMap(location)
Centers the map at the specified location.
| Parameter | Type | Description |
|---|---|---|
| location | LatLng | An instance of LatLng than identifies the center of the map. |
CenterMap(address)
Centers the map at the specified address.
| Parameter | Type | Description |
|---|---|---|
| address | String | The address - to be geocoded - of the new center of the map. |
ClearMarkers()
Removes all the markers from the map.
ClearRoutes()
Clears any routes, if they exist.
CloseInfoWindow(markerId)
Closes the google.maps.InfoWindow related to the specified marker.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The marker unique ID. |
FitBounds(coordinates)
Centers the map around a set of coordinates.
| Parameter | Type | Description |
|---|---|---|
| coordinates | LatLng[] |
GetGeocode(callback, address)
Retrieves geocode information.
| Parameter | Type | Description |
|---|---|---|
| callback | Action<GeocoderResult[]> | The callback method. |
| address | String | The address. |
GetGeocode(callback, location)
Retrieves geocode information.
| Parameter | Type | Description |
|---|---|---|
| callback | Action<GeocoderResult[]> | The callback method. |
| location | LatLng | The location (latitude/longitude)/. |
GetGeocode(callback, lat, lng)
Retrieves geocode information.
| Parameter | Type | Description |
|---|---|---|
| callback | Action<GeocoderResult[]> | The callback method. |
| lat | Double | The latitude. |
| lng | Double | The longitude. |
GetGeocodeAsync(address)
Asynchronously retrieves geocode information.
| Parameter | Type | Description |
|---|---|---|
| address | String | The address. |
Returns: Task<GeocoderResult[]>.
GetGeocodeAsync(location)
Asynchronously retrieves geocode information.
| Parameter | Type | Description |
|---|---|---|
| location | LatLng | The location (latitude/longitude)/. |
Returns: Task<GeocoderResult[]>.
GetGeocodeAsync(lat, lng)
Asynchronously retrieves geocode information.
| Parameter | Type | Description |
|---|---|---|
| lat | Double | The latitude. |
| lng | Double | The longitude. |
Returns: Task<GeocoderResult[]>.
RemoveMarker(markerId)
Removes the marker.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The unique ID of the marker to remove. |
ShowInfoWindow(markerId, html)
Shows an instance of the google.maps.InfoWindow class in relation to the marker.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The marker unique ID. |
| html | String | HTML content to display in the info window. |
ShowInfoWindow(markerId, options)
Shows an instance of the google.maps.InfoWindow class in relation to the marker.
| Parameter | Type | Description |
|---|---|---|
| markerId | String | The marker unique ID. |
| options | Object | Options for the creation of the InfoWindow. See infowindows. |
Events
MapClick
MapMouseEventHandler Fired when the user clicks on the map or a marker.
MapDoubleClick
MapMouseEventHandler Fired when the user double clicks on the map or a marker.
MapDragEnd
EventHandler Fired when the user drags the map.
MapDragStart
EventHandler Fired when the user starts dragging the map.
MapPropertyChanged
MapPropertyChangedEventHandler Fired when the user changes the map by zooming, tilting, or selecting a different map type.
MarkerDragEnd
MarkerDragEventHandler Fired when the user drags a marker.
MarkerDragStart
MarkerDragEventHandler Fired when the user begins dragging a marker.