yandex / mapkit-android-demo

MapKit Android demo
Other
120 stars 59 forks source link

Hybrid type not work #26

Closed m3talover closed 6 years ago

m3talover commented 6 years ago

Hi. i tried change mapstyle but can't see hybrid type. this is my code:

`import android.support.v7.app.AppCompatActivity; import android.os.Bundle;

import com.yandex.mapkit.Animation; import com.yandex.mapkit.MapKitFactory; import com.yandex.mapkit.geometry.Point; import com.yandex.mapkit.map.CameraPosition; import com.yandex.mapkit.map.MapType; import com.yandex.mapkit.mapview.MapView;

public class YandexMapActivity extends AppCompatActivity { private MapView mapview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

    MapKitFactory.setApiKey ("");
    MapKitFactory.initialize(this);
    setContentView(R.layout.activity_yandex_map);
    mapview = (MapView)findViewById (R.id.mapview);
    mapview.getMap().setMapType(MapType.HYBRID);
    mapview.getMap().setMapStyle("sd");
    mapview.getMap().setDebugInfoEnabled(true);
    mapview.getMap().set2DMode(true);
   /* mapview.getMap ().move(
            new CameraPosition(new Point(55.751574, 37.573856), 11.0f, 0.0f, 0.0f),
            new Animation(Animation.Type.SMOOTH, 0),
            null);*/
   //
}

@Override
protected void onStop() {
    super.onStop();
    mapview.onStop();
    MapKitFactory.getInstance().onStop();
}

@Override
protected void onStart() {
    super.onStart();
    mapview.onStart();
    MapKitFactory.getInstance().onStart();
}

}`

eberkovich commented 6 years ago

Hi, the problem is it is needed to use correct api key. Also, setMapStyle method is not relevant to changing type of the map and should not be used in this case.

m3talover commented 6 years ago

i use correct api key. i'm sure about it. How can i change map type to hybrid view? i can't find any document or solution. when i try like this code map show only grids.

eberkovich commented 6 years ago

Does usual map schema work? Does demo application show map and what about https://play.google.com/store/apps/details?id=ru.yandex.yandexmaps?

m3talover commented 6 years ago

if i `MapKitFactory.setApiKey (""); MapKitFactory.initialize(this); setContentView(R.layout.activity_yandex_map); mapview = (MapView)findViewById (R.id.mapview);

}

@Override protected void onStop() { super.onStop(); mapview.onStop(); MapKitFactory.getInstance().onStop(); }

@Override protected void onStart() { super.onStart(); mapview.onStart(); MapKitFactory.getInstance().onStart(); }` use this code i can see map. but i want to see hyrid type or sattelite type layer.

CloseFile commented 6 years ago

Same problem.

vbazhenov commented 6 years ago

Unfortunately, satellite and hybryd maps are not available to public MapKit users.