Skip to content

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

attributetypeDefault valuesRequiredIntroduções
idnumberyesId de arco
startObjectyesPonto de partida
endObjectyesPonto final
passObjectnoPonto de passagem
anglenumber0noÂngulo incluído
widthnumber5noEspessura da linha
colornumber#000000noCor da linha
successfunctionnoA interface chama uma função de retorno de chamada bem -sucedida
failfunctionnoInterface para chamar uma função de retorno de chamada face
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumbeyesLatitude

object.end Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumbeyesLatitude

bject.pass Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumbeyesLatitude

MapContext.addcustomlayer ​

Adicione camadas personalizadas.

parameter

Object object

attributetypeDefault valuesRequiredIntroduções
layerIdstringyesPersonalize o ID da camada
successfunctionnoA interface chama uma função de retorno de chamada bem -sucedida
failfunctionnoInterface para chamar uma função de retorno de chamada face
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
idStringyesID da camada de imagem
srcStringyesCaminho de Picção, Imagem da Rede de Suporte, Caminho Temporoso, Caminho do Pacote de Código
boundsObjectyesCobertura de latitude e longitude
visibleBooleantruenoSeja visível
zIndexNumber1noOrdem de desenho de camada
opacityNumber1noTransparência de camada
successfunctionnoA interface chama uma função de retorno de chamada bem -sucedida
failfunctionnoInterface para chamar uma função de retorno de chamada face
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
southwestObjectyesSul-Latitude e longitude oeste
northeastObjectyesLongitude e latitude do nordeste

bounds.southwest Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumberyesLatitude

bounds.northeast Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumberyesLatitude

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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
markersArrayyesSame afferent map Component marker attribute
clearbooleanfalsenoDo you want to clear all the maps first? markerNão suportado no iOS
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
iconPathstringnoIcon paths, network paths, local paths, package paths supportediOS não apoia
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
pointsArray.Object>yesList of coordinate points to be displayed in the visible area
paddingArray.number>noDistâ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.
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
enableDefaultStylebooleantruenoEnable default aggregate styles
zoomOnClickbooleantruenoWhether to implement aggregation separation when clicking on the already aggregated marker
gridSizenumber60noAggregation algorithm can be aggregated distance, that is, distance less than this value points will be aggregated together, in pixels
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
markerIdnumberyesDesignation marker
pathArrayyesCoordinate string of moving path, coordinate point format {longitude, latitude}
autoRotatebooleantruenoÂngulo de rotação do marcador de valor inicial
durationnumberyesTempo para um movimento suave
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
longitudenumbernoLongitude
latitudenumbernoLatitude
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

javascript
  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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
longitudeNumberyesDestination longitude
latitudeNumberyesDestination latitude
destinationStringyesDestination name
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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

attributetypeDefault valuesRequiredIntroduções
layerIdstringyesPersonalize o ID da camada
successfunctionnoA interface chama uma função de retorno de chamada bem -sucedida
failfunctionnoInterface para chamar uma função de retorno de chamada face
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
idstringyesID da camada de imagem
successfunctionnoA interface chama uma função de retorno de chamada bem -sucedida
failfunctionnoInterface para chamar uma função de retorno de chamada face
completefunctionnoFunçã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 ​

attributetypeDefault valuesRequiredIntroduções
markerIdsArrayyesMarcador de identificação Gather.
successfunctionnoInterface chama a função de retorno de chamada bem -sucedida
failfunctionnoChamadas de interface Funções de retorno de chamada falhas
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
southwestObjectyesSul-Latitude e longitude oeste
northeastObjectyesLongitude e latitude do nordeste
successfunctionnoInterface chama a função de retorno de chamada bem -sucedida
failfunctionnoChamadas de interface Funções de retorno de chamada falhas
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumberyesLatitude

bounds.northeast Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumberyesLatitude

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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
offsetArray.number>yesOffset, two-bit array
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
iconPathstringnoIcon path, support network path, local path, code package path
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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 ​

attributetypeDefault valuesRequiredIntroductionsOutro
markerIdNumberyesDesignation marker
destinationObjectyesDestination point the specified marker moved to
autoRotatebooleanyesSe o marcador gira automaticamente que se move
rotateNumberyesRotating angle of the markeriOS não suporta
moveWithRotatebooleanfalsenoTranslation and rotation at the same timeO iOS não suporta
IDE não suporta
durationNumber1000noAnimation duration. Translation and rotation are calculated separately
animationEndfunctionnoThe callback function returned when the animation ends
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback 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

attributetypeDefault valuesRequiredIntroduções
idStringyesID da camada de imagem
srcStringyesCaminho de Picção, Imagem da Rede de Suporte, Caminho Temporoso, Caminho do Pacote de Código
boundsObjectyesCobertura de latitude e longitude
visibleBooleantruenoSeja visível
zIndexNumber1noOrdem de desenho de camada
opacityNumber1noTransparência de camada
successfunctionnoA interface chama uma função de retorno de chamada bem -sucedida
failfunctionnoInterface para chamar uma função de retorno de chamada face
completefunctionnoFunçã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

attributetypeDefault valuesRequiredIntroduções
southwestObjectyesSul-Latitude e longitude oeste
northeastObjectyesLongitude e latitude do nordeste

bounds.southwest Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumberyesLatitude

bounds.northeast Structure

attributetypeDefault valuesRequiredIntroduções
longitudenumberyesLongitude
latitudenumberyesLatitude