├── .gitignore ├── AMap3DMap ├── AMap3DMap.csproj ├── Additions │ ├── AMap.cs │ ├── AboutAdditions.txt │ └── CrossVectorOverlay.cs ├── Jars │ ├── 3dmap-9.1.0.jar │ └── AboutJars.txt ├── Properties │ └── AssemblyInfo.cs └── Transforms │ ├── EnumFields.xml │ ├── EnumMethods.xml │ └── Metadata.xml ├── AMapAndroidBindSolution.sln ├── AMapDemo ├── AMapDemo.csproj ├── Activites │ ├── Activity2DMap.cs │ └── Activity3DMap.cs ├── Assets │ └── AboutAssets.txt ├── MainActivity.cs ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Resources │ ├── AboutResources.txt │ ├── Resource.Designer.cs │ ├── layout │ │ ├── activity_main.axml │ │ ├── layout2DMap.axml │ │ └── layout3DMap.axml │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ └── values │ │ ├── Strings.xml │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ └── styles.xml └── Utils │ └── AppUtil.cs ├── AMapLocation ├── AMapLocation.csproj ├── Additions │ └── AboutAdditions.txt ├── Jars │ ├── AboutJars.txt │ └── location-6.0.0.jar ├── Properties │ └── AssemblyInfo.cs └── Transforms │ ├── EnumFields.xml │ ├── EnumMethods.xml │ └── Metadata.xml ├── AMapSearch ├── AMapSearch.csproj ├── Additions │ └── AboutAdditions.txt ├── Jars │ ├── AboutJars.txt │ └── search-8.1.0.jar ├── Properties │ └── AssemblyInfo.cs └── Transforms │ ├── EnumFields.xml │ ├── EnumMethods.xml │ └── Metadata.xml ├── Amap2DMap ├── Additions │ └── AboutAdditions.txt ├── Amap2DMap.csproj ├── Jars │ ├── AboutJars.txt │ └── map2d-6.0.0.jar ├── Properties │ └── AssemblyInfo.cs ├── Transforms │ ├── EnumFields.xml │ ├── EnumMethods.xml │ └── Metadata.xml └── packages.config ├── Nuget ├── 2DMapBuild.bat ├── 3DMapBuild.bat ├── LocationBuild.bat ├── SearchBuild.bat ├── amap.xamarin.android.2dmap.nuspec ├── amap.xamarin.android.3dmap.nuspec ├── amap.xamarin.android.location.nuspec └── amap.xamarin.android.search.nuspec └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | ReleaseLibary/ 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | [Xx]64/ 21 | [Xx]86/ 22 | [Bb]uild/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | artifacts/ 48 | 49 | *_i.c 50 | *_p.c 51 | *_i.h 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opendb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | *.VC.db 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | 145 | # TODO: Un-comment the next line if you do not want to checkin 146 | # your web deploy settings because they may include unencrypted 147 | # passwords 148 | #*.pubxml 149 | *.publishproj 150 | 151 | # NuGet Packages 152 | *.nupkg 153 | # The packages folder can be ignored because of Package Restore 154 | **/packages/* 155 | # except build/, which is used as an MSBuild target. 156 | !**/packages/build/ 157 | # Uncomment if necessary however generally it will be regenerated when needed 158 | #!**/packages/repositories.config 159 | # NuGet v3's project.json files produces more ignoreable files 160 | *.nuget.props 161 | *.nuget.targets 162 | 163 | # Microsoft Azure Build Output 164 | csx/ 165 | *.build.csdef 166 | 167 | # Microsoft Azure Emulator 168 | ecf/ 169 | rcf/ 170 | 171 | # Microsoft Azure ApplicationInsights config file 172 | ApplicationInsights.config 173 | 174 | # Windows Store app package directory 175 | AppPackages/ 176 | BundleArtifacts/ 177 | 178 | # Visual Studio cache files 179 | # files ending in .cache can be ignored 180 | *.[Cc]ache 181 | # but keep track of directories ending in .cache 182 | !*.[Cc]ache/ 183 | 184 | # Others 185 | ClientBin/ 186 | [Ss]tyle[Cc]op.* 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # RIA/Silverlight projects 197 | Generated_Code/ 198 | 199 | # Backup & report files from converting an old project file 200 | # to a newer Visual Studio version. Backup files are not needed, 201 | # because we have git ;-) 202 | _UpgradeReport_Files/ 203 | Backup*/ 204 | UpgradeLog*.XML 205 | UpgradeLog*.htm 206 | 207 | # SQL Server files 208 | *.mdf 209 | *.ldf 210 | 211 | # Business Intelligence projects 212 | *.rdl.data 213 | *.bim.layout 214 | *.bim_*.settings 215 | 216 | # Microsoft Fakes 217 | FakesAssemblies/ 218 | 219 | # GhostDoc plugin setting file 220 | *.GhostDoc.xml 221 | 222 | # Node.js Tools for Visual Studio 223 | .ntvs_analysis.dat 224 | 225 | # Visual Studio 6 build log 226 | *.plg 227 | 228 | # Visual Studio 6 workspace options file 229 | *.opt 230 | 231 | # Visual Studio LightSwitch build output 232 | **/*.HTMLClient/GeneratedArtifacts 233 | **/*.DesktopClient/GeneratedArtifacts 234 | **/*.DesktopClient/ModelManifest.xml 235 | **/*.Server/GeneratedArtifacts 236 | **/*.Server/ModelManifest.xml 237 | _Pvt_Extensions 238 | 239 | # LightSwitch generated files 240 | GeneratedArtifacts/ 241 | ModelManifest.xml 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | 246 | # FAKE - F# Make 247 | .fake/ -------------------------------------------------------------------------------- /AMap3DMap/AMap3DMap.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {F65F645A-164A-43D0-9620-9FBAD152593D} 9 | {10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | {77efb91c-a7e9-4b0e-a7c5-31eeec3c6d46} 11 | Library 12 | Properties 13 | AMap3DMap 14 | AMap3DMap 15 | 512 16 | false 17 | v11.0 18 | class-parse 19 | XAJavaInterop1 20 | 21 | 22 | 23 | 24 | true 25 | portable 26 | false 27 | bin\Debug\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | 32 | 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /AMap3DMap/Additions/AMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Android.App; 7 | using Android.Content; 8 | using Android.OS; 9 | using Android.Runtime; 10 | using Android.Views; 11 | using Android.Widget; 12 | using Java.Interop; 13 | 14 | namespace Com.Amap.Api.Maps 15 | { 16 | public sealed partial class AMap : global::Java.Lang.Object 17 | { 18 | 19 | public partial interface IOnCameraChangeListener : IJavaObject, IJavaPeerable 20 | { 21 | 22 | } 23 | 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /AMap3DMap/Additions/AboutAdditions.txt: -------------------------------------------------------------------------------- 1 | Additions allow you to add arbitrary C# to the generated classes 2 | before they are compiled. This can be helpful for providing convenience 3 | methods or adding pure C# classes. 4 | 5 | == Adding Methods to Generated Classes == 6 | 7 | Let's say the library being bound has a Rectangle class with a constructor 8 | that takes an x and y position, and a width and length size. It will look like 9 | this: 10 | 11 | public partial class Rectangle 12 | { 13 | public Rectangle (int x, int y, int width, int height) 14 | { 15 | // JNI bindings 16 | } 17 | } 18 | 19 | Imagine we want to add a constructor to this class that takes a Point and 20 | Size structure instead of 4 ints. We can add a new file called Rectangle.cs 21 | with a partial class containing our new method: 22 | 23 | public partial class Rectangle 24 | { 25 | public Rectangle (Point location, Size size) : 26 | this (location.X, location.Y, size.Width, size.Height) 27 | { 28 | } 29 | } 30 | 31 | At compile time, the additions class will be added to the generated class 32 | and the final assembly will a Rectangle class with both constructors. 33 | 34 | 35 | == Adding C# Classes == 36 | 37 | Another thing that can be done is adding fully C# managed classes to the 38 | generated library. In the above example, let's assume that there isn't a 39 | Point class available in Java or our library. The one we create doesn't need 40 | to interact with Java, so we'll create it like a normal class in C#. 41 | 42 | By adding a Point.cs file with this class, it will end up in the binding library: 43 | 44 | public class Point 45 | { 46 | public int X { get; set; } 47 | public int Y { get; set; } 48 | } -------------------------------------------------------------------------------- /AMap3DMap/Additions/CrossVectorOverlay.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Android.App; 7 | using Android.Content; 8 | using Android.OS; 9 | using Android.Runtime; 10 | using Android.Views; 11 | using Android.Widget; 12 | 13 | namespace Com.Autonavi.Base.AE.Gmap.Gloverlay 14 | { 15 | public partial class CrossVectorOverlay : global::Com.Autonavi.Base.AE.Gmap.Gloverlay.BaseMapOverlay, global::Com.Autonavi.Amap.Mapcore.Interfaces.ICrossVectorOverlay 16 | { 17 | public void SetVisible(bool p0) 18 | { 19 | this.Visible = p0; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /AMap3DMap/Jars/3dmap-9.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-jar/AMapBind/f2c3cfe99e169e26be3abda36026d60d8501f084/AMap3DMap/Jars/3dmap-9.1.0.jar -------------------------------------------------------------------------------- /AMap3DMap/Jars/AboutJars.txt: -------------------------------------------------------------------------------- 1 | This directory is for Android .jars. 2 | 3 | There are 2 types of jars that are supported: 4 | 5 | == Input Jar == 6 | 7 | This is the jar that bindings should be generated for. 8 | 9 | For example, if you were binding the Google Maps library, this would 10 | be Google's "maps.jar". 11 | 12 | Set the build action for these jars in the properties page to "InputJar". 13 | 14 | 15 | == Reference Jars == 16 | 17 | These are jars that are referenced by the input jar. C# bindings will 18 | not be created for these jars. These jars will be used to resolve 19 | types used by the input jar. 20 | 21 | NOTE: Do not add "android.jar" as a reference jar. It will be added automatically 22 | based on the Target Framework selected. 23 | 24 | Set the build action for these jars in the properties page to "ReferenceJar". -------------------------------------------------------------------------------- /AMap3DMap/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("AMap3DMap")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("AMap3DMap")] 14 | [assembly: AssemblyCopyright("Copyright © 2018")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /AMap3DMap/Transforms/EnumFields.xml: -------------------------------------------------------------------------------- 1 |  2 | 14 | -------------------------------------------------------------------------------- /AMap3DMap/Transforms/EnumMethods.xml: -------------------------------------------------------------------------------- 1 |  2 | 13 | -------------------------------------------------------------------------------- /AMap3DMap/Transforms/Metadata.xml: -------------------------------------------------------------------------------- 1 |  2 | 9 | 10 | 11 | 12 | Java.Lang.Object[] 13 | Java.Lang.Object 14 | 15 | Java.Lang.Object[] 16 | Java.Lang.Object 17 | 18 | Java.Lang.Object[] 19 | Java.Lang.Object 20 | 21 | Java.Lang.Object[] 22 | Java.Lang.Object 23 | 24 | Java.Lang.Object[] 25 | Java.Lang.Object 26 | 27 | Java.Lang.Object[] 28 | Java.Lang.Object 29 | 30 | Java.Lang.Object[] 31 | Java.Lang.Object 32 | 33 | Java.Lang.Object[] 34 | Java.Lang.Object 35 | 36 | Java.Lang.Object[] 37 | Java.Lang.Object 38 | 39 | Java.Lang.Object[] 40 | Java.Lang.Object 41 | 42 | Java.Lang.Object[] 43 | Java.Lang.Object 44 | 45 | Java.Lang.Object[] 46 | Java.Lang.Object 47 | 48 | Java.Lang.Object[] 49 | Java.Lang.Object 50 | 51 | Java.Lang.Object[] 52 | Java.Lang.Object 53 | 54 | Java.Lang.Object[] 55 | Java.Lang.Object 56 | 57 | Java.Lang.Object[] 58 | Java.Lang.Object 59 | 60 | Java.Lang.Object[] 61 | Java.Lang.Object 62 | 63 | Java.Lang.Object[] 64 | Java.Lang.Object 65 | 66 | OnMapScreenShoting 67 | 68 | 69 | 70 | protected 71 | 72 | AddIndoorBuildingActive 73 | AddCameraChange 74 | AddMarkerClick 75 | AddMarkerDrag 76 | AddPolylineClick 77 | AddMyLocationChange 78 | AddPOIClick 79 | AddMapTouch 80 | AddMapLongClick 81 | AddMapLoaded 82 | AddMapClick 83 | AddInfoWindowClick 84 | 85 | 86 | protected 87 | protected 88 | protected 89 | 90 | 91 | 92 | 93 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /AMapAndroidBindSolution.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29709.97 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amap2DMap", "Amap2DMap\Amap2DMap.csproj", "{2F1B8A83-5DAF-4CC1-9871-600F2C98D195}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMapDemo", "AMapDemo\AMapDemo.csproj", "{27E2B509-DACD-406B-994E-9661F72E81B1}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMapLocation", "AMapLocation\AMapLocation.csproj", "{455C3C48-BECA-42C7-8E05-024C51E32E8B}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMapSearch", "AMapSearch\AMapSearch.csproj", "{D9229129-2C5E-41D9-B480-61600F9D79A0}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMap3DMap", "AMap3DMap\AMap3DMap.csproj", "{F65F645A-164A-43D0-9620-9FBAD152593D}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {2F1B8A83-5DAF-4CC1-9871-600F2C98D195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {2F1B8A83-5DAF-4CC1-9871-600F2C98D195}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {2F1B8A83-5DAF-4CC1-9871-600F2C98D195}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {2F1B8A83-5DAF-4CC1-9871-600F2C98D195}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {27E2B509-DACD-406B-994E-9661F72E81B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {27E2B509-DACD-406B-994E-9661F72E81B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {27E2B509-DACD-406B-994E-9661F72E81B1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 29 | {27E2B509-DACD-406B-994E-9661F72E81B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {27E2B509-DACD-406B-994E-9661F72E81B1}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {27E2B509-DACD-406B-994E-9661F72E81B1}.Release|Any CPU.Deploy.0 = Release|Any CPU 32 | {455C3C48-BECA-42C7-8E05-024C51E32E8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {455C3C48-BECA-42C7-8E05-024C51E32E8B}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {455C3C48-BECA-42C7-8E05-024C51E32E8B}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {455C3C48-BECA-42C7-8E05-024C51E32E8B}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {D9229129-2C5E-41D9-B480-61600F9D79A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {D9229129-2C5E-41D9-B480-61600F9D79A0}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {D9229129-2C5E-41D9-B480-61600F9D79A0}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {D9229129-2C5E-41D9-B480-61600F9D79A0}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {F65F645A-164A-43D0-9620-9FBAD152593D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {F65F645A-164A-43D0-9620-9FBAD152593D}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {F65F645A-164A-43D0-9620-9FBAD152593D}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {F65F645A-164A-43D0-9620-9FBAD152593D}.Release|Any CPU.Build.0 = Release|Any CPU 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {8BA802CF-4AE9-439E-9CC1-AB0C58516965} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /AMapDemo/AMapDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {27E2B509-DACD-406B-994E-9661F72E81B1} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | {122416d6-6b49-4ee2-a1e8-b825f31c79fe} 11 | Library 12 | Properties 13 | AMapDemo 14 | AMapDemo 15 | 512 16 | True 17 | Resources\Resource.Designer.cs 18 | Resource 19 | Off 20 | false 21 | v11.0 22 | Properties\AndroidManifest.xml 23 | Resources 24 | Assets 25 | 26 | 27 | True 28 | Full 29 | False 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | True 35 | None 36 | False 37 | 38 | 39 | True 40 | PdbOnly 41 | True 42 | bin\Release\ 43 | TRACE 44 | prompt 45 | 4 46 | true 47 | False 48 | SdkOnly 49 | True 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Designer 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 6.0.0 99 | 100 | 101 | 8.1.0 102 | 103 | 104 | 5.6.2 105 | 106 | 107 | 8.1.0 108 | 109 | 110 | 111 | 112 | 113 | Designer 114 | 115 | 116 | 117 | 118 | Designer 119 | 120 | 121 | 122 | 129 | -------------------------------------------------------------------------------- /AMapDemo/Activites/Activity2DMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Android.App; 7 | using Android.Content; 8 | using Android.OS; 9 | using Android.Runtime; 10 | using Android.Views; 11 | using Android.Widget; 12 | using Com.Amap.Api.Location; 13 | using Com.Amap.Api.Maps2d; 14 | 15 | namespace AMapDemo.Activites 16 | { 17 | [Activity(Label = "Activity2DMap")] 18 | public class Activity2DMap : Activity 19 | { 20 | MapView AMapView; 21 | AMapLocationClient LocationClient; 22 | 23 | protected override void OnCreate(Bundle savedInstanceState) 24 | { 25 | base.OnCreate(savedInstanceState); 26 | 27 | SetContentView(Resource.Layout.layout2DMap); 28 | 29 | AMapView = FindViewById(Resource.Id.AMap2DView); 30 | 31 | //在activity执行onCreate时执行mMapView.onCreate(savedInstanceState),创建地图 32 | AMapView.OnCreate(savedInstanceState); 33 | 34 | InitLocation(); 35 | } 36 | protected override void OnDestroy() 37 | { 38 | base.OnDestroy(); 39 | //在activity执行onDestroy时执行mMapView.onDestroy(),销毁地图 40 | AMapView.OnDestroy(); 41 | LocationClient.OnDestroy(); 42 | } 43 | protected override void OnResume() 44 | { 45 | base.OnResume(); 46 | //在activity执行onResume时执行mMapView.onResume (),重新绘制加载地图 47 | AMapView.OnResume(); 48 | } 49 | protected override void OnPause() 50 | { 51 | base.OnPause(); 52 | //在activity执行onPause时执行mMapView.onPause (),暂停地图的绘制 53 | AMapView.OnPause(); 54 | } 55 | protected override void OnSaveInstanceState(Bundle outState) 56 | { 57 | base.OnSaveInstanceState(outState); 58 | ////在activity执行onSaveInstanceState时执行mMapView.onSaveInstanceState (outState),保存地图当前的状态 59 | AMapView.OnSaveInstanceState(outState); 60 | } 61 | 62 | 63 | private void InitLocation() 64 | { 65 | //声明mlocationClient对象 66 | 67 | LocationClient = new AMapLocationClient(this); 68 | //初始化定位参数 69 | AMapLocationClientOption mLocationOption = new AMapLocationClientOption(); 70 | //设置定位监听 71 | LocationClient.SetLocationListener(new LocationListener(this)); 72 | //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式 73 | mLocationOption.SetLocationMode(AMapLocationClientOption.AMapLocationMode.HightAccuracy); 74 | //设置定位间隔,单位毫秒,默认为2000ms 75 | mLocationOption.SetInterval(2000); 76 | //设置定位参数 77 | LocationClient.SetLocationOption(mLocationOption); 78 | // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗, 79 | // 注意设置合适的定位时间的间隔(最小间隔支持为1000ms),并且在合适时间调用stopLocation()方法来取消定位请求 80 | // 在定位结束后,在合适的生命周期调用onDestroy()方法 81 | // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除 82 | //启动定位 83 | LocationClient.StartLocation(); 84 | } 85 | 86 | 87 | class LocationListener : Java.Lang.Object, IAMapLocationListener 88 | { 89 | private readonly Android.Content.Context context; 90 | 91 | public LocationListener(Context ctx) 92 | { 93 | this.context = ctx; 94 | } 95 | 96 | public void OnLocationChanged(AMapLocation location) 97 | { 98 | if (location == null || location.ErrorCode == 0) 99 | { 100 | Toast.MakeText(context, "Error:" + location.ErrorInfo, ToastLength.Long).Show(); 101 | return; 102 | } 103 | 104 | //定位成功回调信息 105 | Toast.MakeText(context, location.Address, ToastLength.Long).Show(); 106 | } 107 | } 108 | 109 | } 110 | } -------------------------------------------------------------------------------- /AMapDemo/Activites/Activity3DMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Android.App; 7 | using Android.Content; 8 | using Android.Locations; 9 | using Android.OS; 10 | using Android.Runtime; 11 | using Android.Views; 12 | using Android.Widget; 13 | using Com.Amap.Api.Maps; 14 | using Com.Amap.Api.Maps.Model; 15 | 16 | namespace AMapDemo.Activites 17 | { 18 | [Activity(Label = "Activity3DMap")] 19 | public class Activity3DMap : Activity 20 | { 21 | MapView AMapView = null; 22 | protected override void OnCreate(Bundle savedInstanceState) 23 | { 24 | base.OnCreate(savedInstanceState); 25 | 26 | SetContentView(Resource.Layout.layout3DMap); 27 | 28 | AMapView = FindViewById(Resource.Id.AMap3DView); 29 | AMapView.OnCreate(savedInstanceState); 30 | 31 | InitMapView(); 32 | } 33 | 34 | private void InitMapView() 35 | { 36 | var aMap = AMapView.Map; 37 | 38 | // 显示实时交通状况 39 | aMap.TrafficEnabled = true; 40 | //地图模式可选类型:MAP_TYPE_NORMAL,MAP_TYPE_SATELLITE,MAP_TYPE_NIGHT 41 | // 卫星地图模式 42 | aMap.MapType = AMap.MapTypeSatellite; 43 | 44 | var uiSettings = aMap.UiSettings; 45 | 46 | //设置默认定位按钮是否显示,非必需设置。 47 | uiSettings.MyLocationButtonEnabled = true; 48 | //控制比例尺控件是否显示 49 | uiSettings.ZoomControlsEnabled = false; 50 | //显示指南针 51 | uiSettings.CompassEnabled = true; 52 | 53 | MyLocationStyle myLocationStyle = new MyLocationStyle(); 54 | //定位一次,且将视角移动到地图中心点 55 | myLocationStyle.InvokeMyLocationType(MyLocationStyle.LocationTypeLocate); 56 | //设置是否显示定位小蓝点 57 | myLocationStyle.ShowMyLocation(true); 58 | //设置连续定位模式下的定位间隔,只在连续定位模式下生效,单次定位模式下不会生效。单位为毫秒。 59 | myLocationStyle.InvokeInterval(2000); 60 | //设置定位蓝点的Style 61 | aMap.MyLocationStyle = myLocationStyle; 62 | 63 | aMap.SetOnMyLocationChangeListener(new AMapLocationChange(this)); 64 | 65 | // 设置为true表示启动显示定位蓝点,false表示隐藏定位蓝点并不进行定位,默认是false 66 | aMap.MyLocationEnabled = true; 67 | } 68 | 69 | protected override void OnDestroy() 70 | { 71 | base.OnDestroy(); 72 | AMapView.OnDestroy(); 73 | } 74 | protected override void OnResume() 75 | { 76 | base.OnResume(); 77 | AMapView.OnResume(); 78 | } 79 | protected override void OnPause() 80 | { 81 | base.OnPause(); 82 | AMapView.OnPause(); 83 | } 84 | protected override void OnSaveInstanceState(Bundle outState) 85 | { 86 | base.OnSaveInstanceState(outState); 87 | AMapView.OnSaveInstanceState(outState); 88 | } 89 | 90 | class AMapLocationChange : Java.Lang.Object, Com.Amap.Api.Maps.AMap.IOnMyLocationChangeListener 91 | { 92 | private readonly Android.Content.Context context; 93 | 94 | public AMapLocationChange(Context ctx) 95 | { 96 | this.context = ctx; 97 | } 98 | 99 | public void OnMyLocationChange(Location location) 100 | { 101 | Toast.MakeText(context, $"Latitude:{location.Latitude},Longitude:{location.Longitude},errorCode:{location.Extras.GetInt("errorCode")}", ToastLength.Long).Show(); 102 | } 103 | } 104 | 105 | } 106 | } -------------------------------------------------------------------------------- /AMapDemo/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); -------------------------------------------------------------------------------- /AMapDemo/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Widget; 3 | using Android.OS; 4 | using Android.Support.V7.App; 5 | using Android.Views; 6 | 7 | namespace AMapDemo 8 | { 9 | [Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)] 10 | public class MainActivity : AppCompatActivity 11 | { 12 | protected override void OnCreate(Bundle savedInstanceState) 13 | { 14 | base.OnCreate(savedInstanceState); 15 | 16 | // Set our view from the "main" layout resource 17 | SetContentView(Resource.Layout.activity_main); 18 | 19 | var btnGo2DMap = FindViewById