0

We want to show our vector tiles on google map, we already done with png tiles with google map SDK's tile provider but we need it with vector tiles GeoJson. I have found some solution like this :

here it has these codes :

public class GoogleMapsActivity extends FragmentActivity {

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu items for use in the action bar
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu_main, menu);
    return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    final Context context = this;

    return super.onOptionsItemSelected(item);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTheme(R.style.DarkTheme);

    if(SettingsActivity.mUnits){
        setContentView(R.layout.google_maps_tracker_metric);
    } else {
        setContentView(R.layout.google_maps_tracker);
    }
}

@Override
protected void onResume(){
    super.onResume();

    // Get both fragments shown on the same screen
    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

    GoogleMapsTracker fragment;
    fragment = GoogleMapsTracker.newInstance();

    GoogleMapsOGLES fragmentOGL;
    fragmentOGL = GoogleMapsOGLES.newInstance();

    fragmentTransaction.add(R.id.map, fragment);
    fragmentTransaction.add(R.id.gl, fragmentOGL);
    fragmentTransaction.commit();
}

@Override
protected void onPause(){
    super.onPause();
}

@Override
protected void onDestroy() { 
    super.onDestroy(); 
}

but this is not complete and has some layouts and classes that not provided. did anyone do this or can help me with it ?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Ali Khoshraftar
  • 521
  • 1
  • 4
  • 16

1 Answers1

0

I believe Google Maps Android API doesn't support vector tiles yet. In Google issue tracker you can find a feature request to add support for vector tiles (currently 6 stars):

https://issuetracker.google.com/issues/35830251

Feel free to star the feature request to add your vote and subscribe to notifications from Google.

xomena
  • 31,125
  • 6
  • 88
  • 117