Examples | Maps SDK | Android | Mapbox
文章推薦指數: 80 %
Code examples for the Mapbox Maps SDK for Android. ... You can find additional examples for the Maps SDK on GitHub. Clone the repository and run the example ... Youareusinganoutdatedbrowserandwillencountersomeproblemswithourwebsite.Pleaseconsiderupgrading.UpgradeNowMapsSDKforAndroidSearchGuidesExamplesAPIReferenceTutorialsTroubleshootingAlldocsMapsSDKforAndroidExamplesExamplesFiltersSearchExampleapplicationonGitHubYoucanfindadditionalexamplesfortheMapsSDKonGitHub.ClonetherepositoryandruntheexampleapplicationfollowingtheinstructionsintheREADME.AddamarkertothemapUsetheMapboxAnnotationsAPI'sPointAnnotationManagertoaddasingleredmarkerpintothemap.DisplayasimplemapviewDisplayamapwiththeMapsSDKforAndroid.AddamarkersymbolAddablueteardrop-shapedmarkerimagetoastyleanddisplayitonthemapusingaSymbolLayer.AddaviewannotationAddaViewAnnotationtoaMapViewwhenthemapisclicked.AddanimatedweatherdataLoadarasterimagetoastyleusingImageSourceanddisplayitonamapasanimatedweatherdatausingRasterLayer.AddviewannotationtoapointannotationAddaViewAnnotationtoaMapViewandanchorittoapointannotation.AddviewannotationsconnectedtofeaturesAddaViewAnnotationtoaMapViewandanchorittoafeatureinasymbollayer.DisplaybuildingextrusionsExtrudethebuildinglayerintheMapboxLightstyleusingFillExtrusionLayerandsetupthelightposition.DisplaymultipleiconimagesinasymbollayerAddpointdataandseveralimagestoastyleandusetheswitchCaseandgetexpressionstochoosewhichimagetodisplayateachpointinaSymbolLayerbasedonadataproperty.Displaytheuser'slocationDisplaytheuser'slocationonamapwiththedefaultuserlocationpuck.DrawaGeoJSONlineLoadapolylinetoastyleusingGeoJsonSourceanddisplayitonamapusingLineLayer.Fly-tocameraanimationAnimatethecamerachangeswiththefly-toanimation.Thiscausesthecameratoeasefromastartingpointtoanenddestination.InsetmapShowasmallerinsetmapfragmentandlinkittoalargermapfortwomapinteraction.LocationcomponentShowslocationpuckonthemap.RestrictmappanningRestrictthemap\'sviewporttoaspecifiedsetofcoordinatesforgesture-basedcamerachanges.Theviewportcanstillbechangedprogrammatically.StylecirclescategoricallyAddpointdatatoastylefromavectortilesetandusethematchandgetexpressionstoassignthecolorofeachpointinaCircleLayerbasedonadataproperty.TintafilllayerAddanimagetoastyleanduseittodisplayapatterninthelanduseFillLayerintheMapboxStreetsstyle.TogglethevisibilityofalayerAllowtheusertotogglethevisibilityofaCircleLayeronamap.UsingcustomcameraanimationsAnimatethemapcameratoanewpositionusingcameraanimators.Individualcamerapropertiessuchaszoom,bearing,andcentercoordinatecanbeanimatedindependently.VisualizedataasaheatmapAddearthquakefrequencydatatoastylefromaGeoJSONfileandrenderitonamapusingaHeatmapLayer.
延伸文章資訊
- 1Mapbox: Maps, geocoding, and navigation APIs & SDKs
Integrate custom live maps, location search, and turn-by-turn navigation into any mobile or web a...
- 2mapbox/mapbox-sdk-js: A JavaScript client to ... - GitHub
A JS SDK for working with Mapbox APIs. Works in Node, the browser, and React Native. As of 6/11/1...
- 3Mapbox Maps SDK for Android | Help
The Mapbox Maps SDK for Android is an open-source toolset for building mapping applications for A...
- 4Maps SDK | Android | Mapbox
The Mapbox Maps SDK for Android is a library for embedding highly customized maps within Android ...
- 5API Reference | Maps SDK | Android | Mapbox
The Mapbox Maps SDK for Android is a toolset for displaying maps inside of your Android applicati...