MapView example errors


#1

Hi, I’m trying to run the MapView example (https://www.fusetools.com/docs/fuse/controls/mapview), but I get this error.

C:\Users\tacon\OneDrive\Documents\Fuse\maps\MainView.ux(4,1): Error : Data type not found: MapView
C:\Users\tacon\OneDrive\Documents\Fuse\maps\MainView.ux(4,1): Error : Could not resolve type 'MapView'
C:\Users\tacon\OneDrive\Documents\Fuse\maps\MainView.ux(4,1): Error : Data type not found: MapView
C:\Users\tacon\OneDrive\Documents\Fuse\maps\MainView.ux(4,1): Error : Could not resolve type 'MapView'

How can I fix this error? These are my unoproj and MainView.ux files:

{
  "RootNamespace":"",
    "Android": {
   "Geo": {
        "ApiKey": "AIzaSyCsKIwCZKllX9aR3GQ1aMaKM94rmxZw958"
    }
}
  "Packages": [
    "Fuse.Maps",
    "Fuse",
    "FuseJS"
  ],

  "Includes": [
    "*"
  ]
}
<App>
	<ClientPanel>
		<NativeViewHost>
			<MapView Latitude="59.911567" Longitude="10.741030" Zoom="10">
				<MapMarker Latitude="59.911567" Longitude="10.741030" Label="Fuse HQ"/>
			</MapView>
		</NativeViewHost>
	</ClientPanel>
</App>

#2

What is the version of fuse you are using?


#3

I’m using the most recent version, 1.0.1


#4

Hi Joshua,

after you add "Fuse.Maps" package in your .unoproj, you should run uno clean in your project root folder, and then rebuild the preview.


#5

When I run uno clean I get this error:

C:\Users\tacon\OneDrive\Documents\Fuse\map>uno clean
ERROR: After parsing a value an unexpected character was encountered: ". Path 'Android', line 8, position 2.

Does anyone else run into the same problems running the MapView example?

EDIT: I got uno clean to work, and the MapView previews properly on my device. Thanks!


#6

You forget to put “,” after } or before “Packages” like the following code:

    {
  "RootNamespace":"",
    "Android": {
    "Geo": {
        "ApiKey": "AIzaSyCsKIwCZKllX9aR3GQ1aMaKM94rmxZw958"
    }
  },
  "Packages": [
    "Fuse.Maps",
    "Fuse",
    "FuseJS"
  ],
  "Includes": [
    "*"
  ]
}