Select to view content in your preferred language

MapView.getGrid().setVisibility(false) error

2543
1
Jump to solution
06-20-2012 05:19 AM
重溪陳
New Contributor II
I want to trun off the grid line on mapview.
And my App crashed when i run the below code:
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
               mMapView = new MapView(this);
  this.addContentView(mMapView, new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
 
  mMapView.getGrid().setVisibility(false);

I got the error message is :java.lang.UnsatisfiedLinkError: nativeSetGridVisibility
If it's wrong way to do it?

Thank's for solution answer.
0 Kudos
1 Solution

Accepted Solutions
DanO_Neill
Deactivated User
Are you trying to set the visibility of the grid behind the map?  That grid is the map background.  The Grid returned from the MapView.getGrid() method is a Grid on the map itself not behind.  Map Grids display index and geographic reference grids on a map, e.g. a degrees/minutes/seconds (DMS) grid label identifies the map grid using degrees, minutes, and seconds.  By default the MapView Grid is set to NONE.  The available grids can be viewed by the Enum Grid.GridType in the JavaDoc API.  Currently we only support NONE (default) and Military Grid Reference System (MGRS).  This may be a bit confusing as our generic Grid class isn't explicit in it's definition and there is a Grid present behind the map by default.  We have addressed the error you were receiving and that will be fixed in our upcoming v2.0 release.  But unfortunately, unless you were working with map grids, as shown in the code below, there is currently not a way to set the visibility to the background grid. 

//add a MGRS grid to the map  MapView.getGrid().setGridType(GridType.MGRS);


Visibility is set to true by default.

View solution in original post

0 Kudos
1 Reply
DanO_Neill
Deactivated User
Are you trying to set the visibility of the grid behind the map?  That grid is the map background.  The Grid returned from the MapView.getGrid() method is a Grid on the map itself not behind.  Map Grids display index and geographic reference grids on a map, e.g. a degrees/minutes/seconds (DMS) grid label identifies the map grid using degrees, minutes, and seconds.  By default the MapView Grid is set to NONE.  The available grids can be viewed by the Enum Grid.GridType in the JavaDoc API.  Currently we only support NONE (default) and Military Grid Reference System (MGRS).  This may be a bit confusing as our generic Grid class isn't explicit in it's definition and there is a Grid present behind the map by default.  We have addressed the error you were receiving and that will be fixed in our upcoming v2.0 release.  But unfortunately, unless you were working with map grids, as shown in the code below, there is currently not a way to set the visibility to the background grid. 

//add a MGRS grid to the map  MapView.getGrid().setGridType(GridType.MGRS);


Visibility is set to true by default.
0 Kudos