Professional Documents
Culture Documents
Mapas
Mapas
¡Crea
aplicaciones!
Acerca de
Acerca de App Inventor Nuestro equipo Entrenadores expertos Aplicación del mes Notas de la versión
Términos de servicio
Educadores
Enseñar Tutoriales
Noticias
En las noticias Eventos Historias desde el campo
Recursos
Primeros pasos Documentación Foros Tutoriales App Inventor Libros Información de código abierto
Investigación Hora del código Recursos adicionales
blogs
Blog del inventor de aplicaciones
Donar
mapas
« Volver al índice
mapas
Tabla de contenido:
Círculo
FeatureCollection
LineString
Mapa
Marcador
Navegación
Polígono
Rectángulo
Círculo
El Circlecomponente visualiza un círculo de un dado Radius, en metros, centrado en a Latitudey
Longitude. La Circleapariencia del puede personalizarse usando propiedades como FillColor,
StrokeColory StrokeWidth.
Propiedades
Descripción text
Establece u obtiene la descripción que se muestra en la ventana de información. La ventana
de información aparece cuando el usuario toca el Circle.
Arrastrable boolean
Establece u obtiene si el usuario puede o no arrastrar una entidad del mapa. Se accede a esta
función presionando prolongadamente y luego arrastrando Circlea una nueva ubicación.
EnableInfobox boolean
Habilita o deshabilita la visualización de la ventana del cuadro de información cuando el
usuario toca el Circle.
Color de relleno color
Establece u obtiene el color utilizado para rellenar el archivo Circle.
Opacidad de relleno num ber
Establece u obtiene la opacidad del color utilizado para rellenar el archivo Circle. Un valor de
0,0 será completamente invisible y un valor de 1,0 será completamente opaco.
Latitud num ber
Establece u obtiene la latitud del centro del círculo, en grados. Los valores positivos
representan el norte del ecuador y los valores negativos representan el sur del ecuador. Para
actualizar la latitud y la longitud simultáneamente, utilice el SetLocationmétodo.
Longitud num ber
Establece u obtiene la longitud del centro del círculo, en grados. Los valores positivos
representan el este del primer meridiano y los valores negativos representan el oeste del
primer meridiano. Para actualizar la latitud y la longitud simultáneamente, utilice el
SetLocationmétodo.
Radio num ber
Establece u obtiene el radio del círculo, en metros.
Color del trazo color
Establece u obtiene el color utilizado para delinear el Circle.
TrazoOpacidad num ber
Establece u obtiene la opacidad del contorno del Circle. Un valor de 0,0 será invisible y un
valor de 1,0 será opaco.
Anchura del trazo num ber
Establece u obtiene el ancho del trazo utilizado para delinear el Circle.
Título text
Establece u obtiene el título que se muestra en la ventana de información que aparece cuando
el usuario hace clic en la función del mapa.
Tipo text read-only, blocks -only
Devuelve el tipo de la característica. Para Círculos, esto devuelve MapFeature.Circle
("Círculo").
Visible boolean
Especifica si Circledebe estar visible en la pantalla. El valor es true si se Circlemuestra y
false si está oculto.
Eventos
Hacer clic()
El Clickevento se ejecuta cuando el usuario toca el Circle.
Arrastrar()
El Dragevento se ejecuta en respuesta a las actualizaciones de posición del Circlemientras el
usuario lo arrastra.
Clic largo()
El LongClickevento se ejecuta cuando el usuario presiona y mantiene presionado Circley luego
lo suelta. Este evento solo se activará si Draggablese false debe a que utiliza el mismo gesto
que StartDrag.
InicioArrastrar()
El StartDragevento se ejecuta cuando el usuario presiona y mantiene presionado Circley luego
procede a mover el dedo en la pantalla. Le seguirán los eventos Dragy StopDrag.
DetenerArrastrar()
El StopDragevento se ejecuta cuando el usuario suelta Circleal final de un arrastre.
Métodos
FeatureCollection
A FeatureCollectionagrupa una o más características del mapa juntas. Cualquier evento que ocurra
en una característica de la colección también activará el evento correspondiente en el componente
de la colección. FeatureCollectionLos correos electrónicos se pueden cargar desde recursos
externos para llenar Mapcorreos electrónicos con contenido. GeoJSON es el único formato admitido
en este momento.
Propiedades
Características lis t blocks -only
Obtiene la lista de entidades adjuntas a FeatureCollection(sin tener en cuenta el valor de la
propiedad de la entidad Visible ). Esta lista también incluye las funciones creadas en las
FeatureCollectionllamadas a FeatureFromDescription.
Características de GeoJSON text write-only
Rellena la colección de características a partir de una cadena que contiene contenido
GeoJSON. Dado el tamaño de dichas cadenas, se recomienda cargar la colección de funciones
desde los activos o la web usando la Sourcepropiedad.
Altura num ber blocks -only
Especifica la FeatureCollectionaltura vertical de , medida en píxeles.
Porcentaje de altura num ber write-only, blocks -only
Especifica la FeatureCollectionaltura vertical de la como un porcentaje de ScreenlaHeight .
Fuente text read-only
Especifica la URL de origen utilizada para completar la colección de características. Si la
colección de características no se cargó desde una URL, esta será la cadena vacía.
Visible boolean
Especifica si FeatureCollectiondebe estar visible en la pantalla. El valor es true si se
FeatureCollectionmuestra y false si está oculto.
Ancho num ber blocks -only
Especifica el ancho horizontal del FeatureCollection, medido en píxeles.
Porcentaje de ancho num ber write-only, blocks -only
Especifica el ancho horizontal de como un porcentajeFeatureCollection de . ScreenWidth
Eventos
Métodos
LineString
LineStringes un componente para dibujar una secuencia abierta y continua de líneas en un archivo
Map. Para agregar nuevos puntos a a LineStringen el diseñador, arrastre el punto medio de cualquier
segmento fuera de la línea para introducir un nuevo vértice. Mueva un vértice haciendo clic y
arrastrando el vértice a una nueva ubicación. Al hacer clic en un vértice, se eliminará el vértice, a
menos que solo queden dos.
Propiedades
Descripción text
Establece u obtiene la descripción que se muestra en la ventana de información. La ventana
de información aparece cuando el usuario toca el LineString.
Arrastrable boolean
Establece u obtiene si el usuario puede o no arrastrar una entidad del mapa. Se accede a esta
función presionando prolongadamente y luego arrastrando LineStringa una nueva ubicación.
EnableInfobox boolean
Habilita o deshabilita la visualización de la ventana del cuadro de información cuando el
usuario toca el LineString.
Puntos lis t blocks -only
La lista de puntos, como pares de latitudes y longitudes, en el LineString.
PuntosDesdeCadena text write-only
Establezca los puntos de LineString a partir de una cadena de caracteres especialmente
codificada de la forma: [[latitud1, longitud1], [latitud2, longitud2], …]
Color del trazo color
Establece u obtiene el color utilizado para delinear el LineString.
TrazoOpacidad num ber
Establece u obtiene la opacidad del contorno del LineString. Un valor de 0,0 será invisible y un
valor de 1,0 será opaco.
Anchura del trazo num ber
Establece u obtiene el ancho del trazo utilizado para delinear el LineString.
Título text
Establece u obtiene el título que se muestra en la ventana de información que aparece cuando
el usuario hace clic en la función del mapa.
Tipo text read-only, blocks -only
Devuelve el tipo de la entidad del mapa. Para LineString, esto devuelve MapFeature.LineString
("LineString").
Visible boolean
Especifica si LineStringdebe estar visible en la pantalla. El valor es true si se
LineStringmuestra y false si está oculto.
Eventos
Hacer clic()
El Clickevento se ejecuta cuando el usuario toca el LineString.
Arrastrar()
El Dragevento se ejecuta en respuesta a las actualizaciones de posición del LineStringmientras
el usuario lo arrastra.
Clic largo()
El LongClickevento se ejecuta cuando el usuario presiona y mantiene presionado LineStringy
luego lo suelta. Este evento solo se activará si Draggablese false debe a que utiliza el mismo
gesto que StartDrag.
InicioArrastrar()
El StartDragevento se ejecuta cuando el usuario presiona y mantiene presionado LineStringy
luego procede a mover el dedo en la pantalla. Le seguirán los eventos Dragy StopDrag.
DetenerArrastrar()
El StopDragevento se ejecuta cuando el usuario suelta LineStringal final de un arrastre.
Métodos
Mapa
Un contenedor bidimensional que representa mosaicos de mapa en segundo plano y permite que
múltiples Markerelementos identifiquen puntos en el mapa. Los mosaicos de mapas son
proporcionados por colaboradores de OpenStreetMap y el Servicio Geológico de los Estados
Unidos.
El Mapcomponente proporciona tres utilidades para manipular sus límites con App Inventor. En
primer lugar, se proporciona un mecanismo de bloqueo para permitir que el mapa se mueva en
relación con otros componentes de la pantalla. En segundo lugar, cuando está desbloqueado, el
usuario puede desplazarse Mapa cualquier ubicación. En esta nueva ubicación, se puede presionar
el botón "Establecer límite inicial" para guardar las Mapcoordenadas actuales en sus propiedades.
Por último, si se Mapmueve a una ubicación diferente, por ejemplo, para agregar Markers fuera de la
pantalla, el botón "Restablecer mapa a los límites iniciales" se puede usar para volver a centrar el
Mapen la ubicación inicial.
Propiedades
1. Carreteras
2. Aéreo
3. Terreno
Nota: las capas de carreteras las proporciona OpenStreetMap y las capas aéreas y de terreno
las proporciona el Servicio Geológico de EE. UU.
Rotación num ber
Especifica la rotación del mapa en grados decimales, si corresponde.
Unidades de escala num ber
Especifica las unidades utilizadas para la superposición de escala. 1 (predeterminado) dará
unidades métricas (km, m) mientras que 2 dará unidades imperiales (mi, ft).
MostrarBrújula boolean
Especifica si se superpone una brújula en el mapa. La brújula girará en función de la
orientación del dispositivo si hay una brújula digital presente en el hardware.
MostrarEscala boolean
Muestra una referencia de escala en el mapa.
MostrarUsuario boolean
Muestra u oculta un icono que indica la ubicación actual del usuario en el Map. La
disponibilidad y precisión de esta función dependerá de si el usuario tiene habilitados los
servicios de ubicación y qué proveedores de ubicación están disponibles.
MostrarZoom boolean
Especifica si mostrar o no los controles de zoom.
UsuarioLatitud num ber read-only, blocks -only
Devuelve la latitud del usuario si ShowUser está habilitado.
Longitud de usuario num ber read-only, blocks -only
Devuelve la longitud del usuario si ShowUser está habilitado.
Visible boolean
Especifica si Mapdebe estar visible en la pantalla. El valor es true si se Mapmuestra y false si
está oculto.
Ancho num ber blocks -only
Especifica el ancho horizontal del Map, medido en píxeles.
Porcentaje de ancho num ber write-only, blocks -only
Especifica el ancho horizontal de como un porcentajeMap de . ScreenWidth
Nivel de zoom num ber
Especifica el nivel de zoom del mapa. Los valores válidos de ZoomLevel dependen del
proveedor de teselas y de la latitud y longitud del mapa. Por ejemplo, los niveles de zoom
están más restringidos sobre los océanos que sobre los centros urbanos densos para
conservar espacio para almacenar mosaicos, por lo que los valores válidos pueden ser 1-7
sobre el océano y 1-20 sobre las ciudades. Los proveedores de mosaicos pueden enviar
mosaicos de advertencia o error si el nivel de zoom es demasiado alto para que el servidor lo
admita.
Eventos
Cambio de límites()
El BoundsChangeevento se ejecuta cuando el usuario cambia los límites del mapa, ya sea
haciendo zoom, desplazando o girando la vista.
DoubleTapAtPoint ( num ber latitud , num ber longitud )
Se DoubleTapAtPointejecuta cuando el usuario toca dos veces en un punto del mapa. La
ubicación tocada se informará en las coordenadas del mapa a través de los parámetros
latitude y longitude .
FeatureClick ( com ponent característica )
Cuando se hace clic en una característica, el padre Maptambién recibirá un FeatureClickevento.
El featureparámetro indica en qué función secundaria se hizo clic. Este evento se ejecuta
después del Clickevento en la característica correspondiente y después del when any ...
Clickevento si se proporciona uno.
FeatureDrag ( com ponent característica )
Cuando el usuario arrastra una característica, el padre Maptambién recibirá un
FeatureDragevento. El featureparámetro indica qué función secundaria se arrastró. Este evento
se ejecuta después del Dragevento en la característica correspondiente y después del when any
... Dragevento si se proporciona uno.
FeatureLongClick ( com ponent característica )
Cuando se hace clic largo en una característica, el padre Maptambién recibirá un
FeatureLongClickevento. El featureparámetro indica en qué función secundaria se hizo clic
durante mucho tiempo. Este evento se ejecuta después del LongClickevento en la característica
correspondiente y después del when any ... LongClickevento si se proporciona uno.
FeatureStartDrag ( com ponent característica )
Cuando el usuario comienza a arrastrar una característica, el padre Maptambién recibirá un
FeatureStartDragevento. El featureparámetro indica qué función secundaria se arrastró. Este
evento se ejecuta después del StartDragevento en la característica correspondiente y después
del when any ... StartDragevento si se proporciona uno.
FeatureStopDrag ( com ponent característica )
Cuando el usuario deja de arrastrar una característica, el padre Maptambién recibirá un
FeatureStopDragevento. El featureparámetro indica qué función secundaria se arrastró. Este
evento se ejecuta después del StopDragevento en la característica correspondiente y después
del when any ... StopDragevento si se proporciona uno.
GotFeatures ( text url , lis t características )
El GotFeaturesevento se ejecuta cuando una colección de características se lee correctamente
del archivo url . El features parámetro será una lista de descripciones de características que
se pueden convertir en componentes usando el FeatureFromDescriptionmétodo.
Punto inválido ( text mensaje )
El InvalidPointevento se ejecuta cuando el programa encuentra un punto no válido mientras
procesa datos geográficos. Los puntos se consideran inválidos cuando la latitud o longitud del
punto está fuera del rango aceptable ( [-90, 90]y [-180, 180], respectivamente). El
messageparámetro contendrá una explicación del error.
LoadError ( text url , num ber código de respuesta , text mensaje de error )
El LoadErrorevento se ejecuta cuando se produce un error al procesar un documento de
colección de características en el url . El responseCode parámetro contendrá un código de
estado HTTP y el errorMessage parámetro contendrá un mensaje de error detallado.
LongPressAtPoint ( num ber latitud , num ber longitud )
Se LongPressAtPointejecuta cuando el usuario presiona prolongadamente en un punto del mapa
sin mover el dedo (lo que provocaría un arrastre). La ubicación de la pulsación larga se
informará en las coordenadas del mapa a través de los parámetros latitude y longitude .
Listo()
El Readyevento se ejecuta una vez que se Mapha inicializado y está listo para la interacción del
usuario.
TapAtPoint ( num ber latitud , num ber longitud )
Se TapAtPointejecuta cuando el usuario toca en un punto del mapa. La ubicación tocada se
informará en las coordenadas del mapa a través de los parámetros latitude y longitude .
ZoomCambiar()
El ZoomChangeevento se ejecuta cuando el usuario ha cambiado el nivel de zoom del mapa,
pellizcando o tocando dos veces para hacer zoom.
Métodos
Marcador
El Markercomponente indica puntos en un Map, como edificios u otros puntos de interés. MarkerLos
correos electrónicos se pueden personalizar de muchas maneras, como usar imágenes
personalizadas de los recursos de la aplicación o cambiar el archivo Marker FillColor. MarkerLos
correos electrónicos también se pueden crear dinámicamente llamando al MapmétodoCreateMarker y
configurarlos usando los bloques "Cualquier componente" .
Propiedades
Events
Click()
The Click event runs when the user taps on the Marker.
Drag()
The Drag event runs in response to position updates of the Marker as the user drags it.
LongClick()
The LongClick event runs when the user presses and holds the Marker and then releases it. This
event will only trigger if Draggable is false because it uses the same gesture as StartDrag.
StartDrag()
The StartDrag event runs when the user presses and holds the Marker and then proceeds to
move their finger on the screen. It will be followed by the Drag and StopDrag events.
StopDrag()
The StopDrag event runs when the user releases the Marker at the end of a drag.
Methods
Navigation
The Navigation component generates directions between two locations using a service called
OpenRouteService. You must provide a valid API key from that service in order for this component
to work.
Properties
Events
GotDirections( lis t directions, lis t points, num ber distance, num ber duration)
Event indicating that a request has finished and has returned data. The following parameters
are provided:
RequestDirections()
Request directions from the routing service using the values of StartLatitude, StartLongitude,
EndLatitude, and EndLongitude. On success, the GotDirections event block will run. If an error
occurs, the error will be reported via the Screen's ErrorOccurred event.
Polygon
Polygon encloses an arbitrary 2-dimensional area on a Map. Polygons can be used for drawing a
perimeter, such as a campus, city, or country. Polygons begin as basic triangles. New vertices can be
created by dragging the midpoint of a polygon away from the edge. Clicking on a vertex will remove
the vertex, but a minimum of 3 vertices must exist at all times.
Properties
Description text
Sets or gets the description displayed in the info window. The info window appears when the
user taps on the Polygon.
Draggable boolean
Sets or gets whether or not the user can drag a map feature. This feature is accessed by long-
pressing and then dragging the Polygon to a new location.
EnableInfobox boolean
Enables or disables the infobox window display when the user taps the Polygon.
FillColor color
Sets or gets the color used to fill in the Polygon.
FillOpacity num ber
Sets or gets the opacity of the color used to fill the Polygon. A value of 0.0 will be completely
invisible and a value of 1.0 will be completely opaque.
HolePoints lis t blocks -only
Specifies the points of any holes in the Polygon. The HolePoints property is a list of lists, with
each sublist containing (latitude, longitude) points representing a hole.
HolePointsFromString text write-only
Specifies holes in a Polygonfrom a GeoJSON string. In contrast to HolePoints, the longitude of
each point comes before the latitude as stated in the GeoJSON specification.
Points lis t blocks -only
Specifies the Points used for drawing the Polygon. The Points are specified as a list of lists
containing latitude and longitude values, such as [[lat1, long1], [lat2, long2], ...].
PointsFromString text write-only
Specifies the points for the Polygon from a GeoJSON string. Unlike Points, this property expects
that the longitude comes first in the point rather than the latitude.
StrokeColor color
Sets or gets the color used to outline the Polygon.
StrokeOpacity num ber
Sets or gets the opacity of the outline of the Polygon. A value of 0.0 will be invisible and a value
of 1.0 will be opaque.
StrokeWidth num ber
Sets or gets the width of the stroke used to outline the Polygon.
Title text
Sets or gets the title displayed in the info window that appears when the user clicks on the map
feature.
Type text read-only, blocks -only
Returns the type of the feature. For polygons, this returns MapFeature.Polygon (“Polygon”).
Visible boolean
Specifies whether the Polygon should be visible on the screen. Value is true if the Polygon is
showing and false if hidden.
Events
Click()
The Click event runs when the user taps on the Polygon.
Drag()
The Drag event runs in response to position updates of the Polygon as the user drags it.
LongClick()
The LongClick event runs when the user presses and holds the Polygon and then releases it. This
event will only trigger if Draggable is false because it uses the same gesture as StartDrag.
StartDrag()
The StartDrag event runs when the user presses and holds the Polygon and then proceeds to
move their finger on the screen. It will be followed by the Drag and StopDrag events.
StopDrag()
The StopDrag event runs when the user releases the Polygon at the end of a drag.
Methods
lis t Centroid()
Gets the centroid of the Polygon as a (latitude, longitude) pair.
num ber DistanceToFeature( com ponent mapFeature, boolean centroids)
Computes the distance between the Polygon and the given mapFeature. If centroids is true , the
computation is done between the centroids of the two features. Otherwise, the distance will be
computed between the two features based on the closest points. Further, when centroids is
false , this method will return 0 if the Polygon intersects or contains the mapFeature. If an error
occurs, this method will return -1.
num ber DistanceToPoint( num ber latitude, num ber longitude, boolean centroid)
Computes the distance between the Polygon and the given latitude and longitude. If centroids is
true , the distance is computed from the center of the Polygon to the given point. Otherwise, the
distance is computed from the closest point on the Polygon to the given point. Further, this
method will return 0 if centroids is false and the point is in the Polygon. If an error occurs, -1
will be returned.
HideInfobox()
Hides the Polygon’s info box if it is visible. Otherwise, no action is taken.
ShowInfobox()
Shows the info box for the Polygon if it is not visible. Otherwise, this method has no effect. This
method can be used to show the info box even if EnableInfobox is false.
Rectangle
Rectangles are polygons withfixed latitudes and longitudes for the north, south, east, and west
boundaries. Moving a vertex of the Rectangle updates the appropriate edges accordingly.
Properties
Description text
Sets or gets the description displayed in the info window. The info window appears when the
user taps on the Rectangle.
Draggable boolean
Sets or gets whether or not the user can drag a map feature. This feature is accessed by long-
pressing and then dragging the Rectangle to a new location.
EastLongitude num ber
Specifies the east-most edge of the Rectangle, in decimal degrees east of the prime meridian.
EnableInfobox boolean
Enables or disables the infobox window display when the user taps the Rectangle.
FillColor color
Sets or gets the color used to fill in the Rectangle.
FillOpacity num ber
Sets or gets the opacity of the color used to fill the Rectangle. A value of 0.0 will be completely
invisible and a value of 1.0 will be completely opaque.
NorthLatitude num ber
Specifies the north-most edge of the Rectangle, in decimal degrees north of the equator.
SouthLatitude num ber
Specifies the west-most edge of the Rectangle, in decimal degrees east of the prime meridian.
StrokeColor color
Sets or gets the color used to outline the Rectangle.
StrokeOpacity num ber
Sets or gets the opacity of the outline of the Rectangle. A value of 0.0 will be invisible and a
value of 1.0 will be opaque.
StrokeWidth num ber
Sets or gets the width of the stroke used to outline the Rectangle.
Title text
Sets or gets the title displayed in the info window that appears when the user clicks on the map
feature.
Type text read-only, blocks -only
Returns the type of the feature. For rectangles, this returns MapFeature.Rectangle
(“Rectangle”).
Visible boolean
Specifies whether the Rectangle should be visible on the screen. Value is true if the Rectangle is
showing and false if hidden.
WestLongitude num ber
Specifies the south-most edge of the Rectangle, in decimal degrees south of the equator.
Events
Click()
The Click event runs when the user taps on the Rectangle.
Drag()
The Drag event runs in response to position updates of the Rectangle as the user drags it.
LongClick()
The LongClick event runs when the user presses and holds the Rectangle and then releases it.
This event will only trigger if Draggable is false because it uses the same gesture as StartDrag.
StartDrag()
The StartDrag event runs when the user presses and holds the Rectangle and then proceeds to
move their finger on the screen. It will be followed by the Drag and StopDrag events.
StopDrag()
The StopDrag event runs when the user releases the Rectangle at the end of a drag.
Methods
lis t Bounds()
Returns the bounding box of the Rectangle in the format ((North West) (South East)).
lis t Center()
Returns the center of the Rectangle as a list of the form (Latitude Longitude).
num ber DistanceToFeature( com ponent mapFeature, boolean centroids)
Computes the distance between the Rectangle and the given mapFeature. If centroids is true , the
computation is done between the centroids of the two features. Otherwise, the distance will be
computed between the two features based on the closest points. Further, when centroids is
false , this method will return 0 if the Rectangle intersects or contains the mapFeature. If an error
occurs, this method will return -1.
num ber DistanceToPoint( num ber latitude, num ber longitude, boolean centroid)
Computes the distance between the Rectangle and the given latitude and longitude. If centroids
is true , the distance is computed from the center of the Rectangle to the given point. Otherwise,
the distance is computed from the closest point on the Rectangle to the given point. Further, this
method will return 0 if centroids is false and the point is in the Rectangle. If an error occurs, -1
will be returned.
HideInfobox()
Hides the Rectangle’s info box if it is visible. Otherwise, no action is taken.
SetCenter( num ber latitude, num ber longitude)
Mueva el Rectanglepara que se centre en el dado latitudey longitude, tratando de mantener el
ancho y la altura (en metros) tan iguales como sea posible, ajustándose a los cambios de
latitud.
Mostrar cuadro de información ()
Muestra el cuadro de información para el Rectanglesi no está visible. De lo contrario, este
método no tiene ningún efecto. Este método se puede usar para mostrar el cuadro de
información incluso si EnableInfoboxes falso.
Soporte / Ayuda
Otras Consultas
Twitter: @MITAppInventor
GitHub: mit-cml