Pergunta

"I have to load a kmz file in to the android application that i am developing and that kmz file will be loaded from sdcard in to the application. So what i should do for that whether there is direct uri intent or i have to parse it by xml parsing if so then how to load coordinates in to the map to show that kmz file.

Foi útil?

Solução

To use the native v3 KmlLayer, which supports kmz files, subject to the documented size and complexity restrictions, the kmz file must be publicly available on the web (so google's servers can get to it).

To use a local file (which it sounds like you do), your only option is to use a third party parser like geoxml3 or geoxml-v3.

Outras dicas

to open in android studio use below code :

    try {
     KmlLayer layer = new KmlLayer(mGoogleMap,R.raw.filename, 
                      getApplicationContext()); 
       // creating the kml layer, put the file in res/raw
     layer.addLayerToMap();
            } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top