Mapa
createMapContext
createMapContext(string mapId)
Criar mapa contexto mapContext Objeto.
parameter
parâmetro String mapid ID do componente do mapa
Return value
MapContext
MapContext
MapContext.addarc
Adicione arco, ponto de aprovação e ângulo devem definir um
parameter
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| id | number | yes | Id de arco | |
| start | Object | yes | Ponto de partida | |
| end | Object | yes | Ponto final | |
| pass | Object | no | Ponto de passagem | |
| angle | number | 0 | no | Ângulo incluído |
| width | number | 5 | no | Espessura da linha |
| color | number | #000000 | no | Cor da linha |
| success | function | no | A interface chama uma função de retorno de chamada bem -sucedida | |
| fail | function | no | Interface para chamar uma função de retorno de chamada face | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
object.start Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | numbe | yes | Latitude |
object.end Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | numbe | yes | Latitude |
bject.pass Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | numbe | yes | Latitude |
MapContext.addcustomlayer
Adicione camadas personalizadas.
parameter
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| layerId | string | yes | Personalize o ID da camada | |
| success | function | no | A interface chama uma função de retorno de chamada bem -sucedida | |
| fail | function | no | Interface para chamar uma função de retorno de chamada face | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
MapContext.addgroundOverlay
Crie uma camada de imagem personalizada e a imagem será dimensionada à medida que o mapa é dimensionado.
parameter
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| id | String | yes | ID da camada de imagem | |
| src | String | yes | Caminho de Picção, Imagem da Rede de Suporte, Caminho Temporoso, Caminho do Pacote de Código | |
| bounds | Object | yes | Cobertura de latitude e longitude | |
| visible | Boolean | true | no | Seja visível |
| zIndex | Number | 1 | no | Ordem de desenho de camada |
| opacity | Number | 1 | no | Transparência de camada |
| success | function | no | A interface chama uma função de retorno de chamada bem -sucedida | |
| fail | function | no | Interface para chamar uma função de retorno de chamada face | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
object.bounds Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| southwest | Object | yes | Sul-Latitude e longitude oeste | |
| northeast | Object | yes | Longitude e latitude do nordeste |
bounds.southwest Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | number | yes | Latitude |
bounds.northeast Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | number | yes | Latitude |
MapContext.addMarkers
Add to marker
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| markers | Array | yes | Same afferent map Component marker attribute | ||
| clear | boolean | false | no | Do you want to clear all the maps first? marker | Não suportado no iOS |
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.addvisuAllayer
Não suportado
MapContext.FromScreenLocation
Recebe a latitude e a longitude correspondentes ao ponto na tela.-canto esquerdo do mapa
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.getCenterLocation
Obtenha o altital e a longitude do centro de mapa atual. O sistema de coordenadas GCJ02 é a retirada, que pode ser usada para pz.openlocation ()
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| iconPath | string | no | Icon paths, network paths, local paths, package paths supported | iOS não apoia | |
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.GetRegion
Adquirir o escopo do campo de visão do mapa atual
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.getRotate
Recebe a rotação agle do mapa atual
Support :
System map (iOS only)
❌
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.getScale
Adquirir o grau de escala do mapa atual
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.getskew
Recebe o ângulo de inclinação do mapa atual
Support :
System map (iOS only)
❌
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.includePoints
Escala a vista do fogo para exibir todos os graus de latitude e longitude "
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ❌
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| points | Array.Object> | yes | List of coordinate points to be displayed in the visible area | ||
| padding | Array.number> | no | Distância entre a borda do retângulo formado por pontos coordenais e a borda do mapa (em pixel). O formato é [superior, direito, inferior, esquerdo]. Somente o primeiro it -m da matriz pode ser identificado no Android. Consistente para os parâmetros superior, inferior, esquerdo e direito. Atualmente, os parâmetros de preenchimento não são suportados nas ferramentas Deverter. | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.initmarkerCluster
Inicializa a configuração da agregação de pontos, a configuração padrão quando não é invocado
Support :
System map (iOS only)
❌
Amap
iOS:❌ Android:✅ Not supported enableDefaultStyle IDE:❌
Baidu map (iOS, Android only)
iOS:❌ Android:✅ enableDefaultStyle is not supported
Google Maps (Android only)
✅ enableDefaultStyle is not supported
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| enableDefaultStyle | boolean | true | no | Enable default aggregate styles | |
| zoomOnClick | boolean | true | no | Whether to implement aggregation separation when clicking on the already aggregated marker | |
| gridSize | number | 60 | no | Aggregation algorithm can be aggregated distance, that is, distance less than this value points will be aggregated together, in pixels | |
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.movealong
Mova -se ao longo de um marcador de caminho especificado para reprodução de rastreamento e outros cenários. Um evento de retorno de chamada é tridado, a animação está concluída. Se a animação estiver em andamento, o método de chamada de marcador novamente, a animação anterior será interrompida
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| markerId | number | yes | Designation marker | ||
| path | Array | yes | Coordinate string of moving path, coordinate point format {longitude, latitude} | ||
| autoRotate | boolean | true | no | Ângulo de rotação do marcador de valor inicial | |
| duration | number | yes | Tempo para um movimento suave | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.Movetology
Mova o centro do mapa para a posição atual do conjunto. Precisa ser usado na coordenação com o show do componente do mapa-localização
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| longitude | number | no | Longitude | ||
| latitude | number | no | Latitude | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.on
Monitore os eventos do mapa: 'MarkerClusterCreate'tred'trict ao escalar ou arrastar faz com que um novo cluster agregado seja gerado, apenas a informação agregada recém -criada é a retirada;
Support :
System map (iOS only)
❌
Amap
iOS:❌ Android:✅ Not supported markerClusterCreate IDE:❌
Baidu map (iOS, Android only)
markerClusterCreate is not supported on iOS:❌ Android:✅
Google Maps (Android only)
✅ does not support markerClusterCreate
Código de amostra
MapContext.on('markerClusterCreate', (res) => {})
MapContext.on('markerClusterClick', (res) => {})MapContext.openmapap
Puxe o aplicativo de mapa e selecione navegação
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ❌
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| longitude | Number | yes | Destination longitude | ||
| latitude | Number | yes | Destination latitude | ||
| destination | String | yes | Destination name | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.RemoveCustomlayer
Remova a camada de publicação.
parâmetro
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| layerId | string | yes | Personalize o ID da camada | |
| success | function | no | A interface chama uma função de retorno de chamada bem -sucedida | |
| fail | function | no | Interface para chamar uma função de retorno de chamada face | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
MapContext.RemoveGroundOverlay
Remova a camada de imagem personalizada.
parâmetro
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| id | string | yes | ID da camada de imagem | |
| success | function | no | A interface chama uma função de retorno de chamada bem -sucedida | |
| fail | function | no | Interface para chamar uma função de retorno de chamada face | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
MapContext.RemoVemarker
Para remover o marcador
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| markerIds | Array | yes | Marcador de identificação Gather. | |
| success | function | no | Interface chama a função de retorno de chamada bem -sucedida | |
| fail | function | no | Chamadas de interface Funções de retorno de chamada falhas | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
MapContext.setBoundery
Limite a área de exibição do mapa
parâmetro
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| southwest | Object | yes | Sul-Latitude e longitude oeste | |
| northeast | Object | yes | Longitude e latitude do nordeste | |
| success | function | no | Interface chama a função de retorno de chamada bem -sucedida | |
| fail | function | no | Chamadas de interface Funções de retorno de chamada falhas | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
bounds.southwest Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | number | yes | Latitude |
bounds.northeast Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | number | yes | Latitude |
MapContext.removeVisuAllayer
Não suporta.
MapContext.SetCenteroffset
Defina o MAP Center Point Office, Download de volta, intervalo de escala de tela (0,250,75) O escritório padrão é [0,5, 0,5]
Support :
System map (iOS only)
❌
Amap
iOS: ✅ Android: ✅ IDE: ❌
Baidu map (iOS, Android only)
iOS: ❌ Android: ❌
Google Maps (Android only)
❌
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| offset | Array.number> | yes | Offset, two-bit array | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.SetLocmarkericon
Defina o ícone âncora, o caminho da rede de suporte, o caminho local, o caminho do pacote de código
Support :
System map (iOS only)
❌
Amap
iOS: ✅ Android: ✅ IDE: ❌
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
❌
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| iconPath | string | no | Icon path, support network path, local path, code package path | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.toscreenLocation
Obtenha as coordenadas da tela correspondentes a latitude e longitude.
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ❌
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.Translatemarker
Translation market, animated
Support :
System map (iOS only)
✅
Amap
iOS: ✅ Android: ✅ IDE: ✅
Baidu map (iOS, Android only)
iOS: ✅ Android: ✅
Google Maps (Android only)
✅
parâmetro
| attribute | type | Default values | Required | Introductions | Outro |
|---|---|---|---|---|---|
| markerId | Number | yes | Designation marker | ||
| destination | Object | yes | Destination point the specified marker moved to | ||
| autoRotate | boolean | yes | Se o marcador gira automaticamente que se move | ||
| rotate | Number | yes | Rotating angle of the marker | iOS não suporta | |
| moveWithRotate | boolean | false | no | Translation and rotation at the same time | O iOS não suporta IDE não suporta |
| duration | Number | 1000 | no | Animation duration. Translation and rotation are calculated separately | |
| animationEnd | function | no | The callback function returned when the animation ends | ||
| success | function | no | Interface calls the successful callback function | ||
| fail | function | no | Interface calls failed callback functions | ||
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
MapContext.UpDateGroundOverlay
Atualizar camadas de imagem personalizadas.
parameter
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| id | String | yes | ID da camada de imagem | |
| src | String | yes | Caminho de Picção, Imagem da Rede de Suporte, Caminho Temporoso, Caminho do Pacote de Código | |
| bounds | Object | yes | Cobertura de latitude e longitude | |
| visible | Boolean | true | no | Seja visível |
| zIndex | Number | 1 | no | Ordem de desenho de camada |
| opacity | Number | 1 | no | Transparência de camada |
| success | function | no | A interface chama uma função de retorno de chamada bem -sucedida | |
| fail | function | no | Interface para chamar uma função de retorno de chamada face | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
object.bounds Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| southwest | Object | yes | Sul-Latitude e longitude oeste | |
| northeast | Object | yes | Longitude e latitude do nordeste |
bounds.southwest Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | number | yes | Latitude |
bounds.northeast Structure
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| longitude | number | yes | Longitude | |
| latitude | number | yes | Latitude |