Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
dhaneshshastri
Posts: 28
Registered: ‎12-19-2012
My Device: BB 10

'UnsupportedOptionError' error while Geocoding or Reverse Geocoding

Hello,

I am trying to use the Geocoding and Reverse Geocoding feature,

I used the code snippets provided here 

http://developer.blackberry.com/native/documentation/cascades/device_platform/location/geocoding.htm...

 

But it returns the error 

 'The requested operation or one of the options for the operation are not supported by the service provider'

 

 

 

What am I missing !

 

Please help !

 

 

BlackBerry Development Advisor
shaque
Posts: 246
Registered: ‎07-14-2008
My Device: Not Specified

Re: 'UnsupportedOptionError' error while Geocoding or Reverse Geocoding

Hi,
Can you share the exact code snippet that is throwing the error? Also, please confirm that you have added location permissions to your bar-descriptor.xml.

Thanks.

Shadid
New Developer
dhaneshshastri
Posts: 28
Registered: ‎12-19-2012
My Device: BB 10

Re: 'UnsupportedOptionError' error while Geocoding or Reverse Geocoding

[ Edited ]

 

This is what I am using, I am following the example provided by blackberry.

 

 

 

// Initialize QGeoSearchManager

    QStringList serviceProviders =

            QGeoServiceProvider::availableServiceProviders();

 

    if ( serviceProviders.size() ) {

 

        SafeDelete(serviceProvider);

        // serviceProvider is a QGeoServiceProvider *

        serviceProvider = new QtMobilitySubset::QGeoServiceProvider(

                serviceProviders.at(0));

        // searchManager is a QGeoSearchManager *

        SafeDelete(searchManager);

        searchManager = serviceProvider->searchManager();

    }

 

    QtMobilitySubset::QGeoAddress address = QtMobilitySubset::QGeoAddress();

    address.setStreet(locality);

    address.setCity(city);

    // Request geocoding

    SafeDelete(reply);

    reply = searchManager->geocode(address);

    bool finished_connected = QObject::connect(reply,

            SIGNAL(finished()),

            this,

            SLOT(readGeocode()));

 

    Q_ASSERT(finished_connected);

 

 

    bool error_connected = QObject::connect(reply,

            SIGNAL(error(QGeoSearchReply::Error, QString)),

            this,

            SLOT(geocodeError(QGeoSearchReply::Error, QString)));

 

 

    Q_ASSERT(error_connected);

 

 

void Geocoder::readGeocode()

{

    if(!reply->places().size())

        return;

    QGeoPlace place = reply->places().at(0);

    qDebug() << place.address().text();

    // SafeDelete(reply);

    _searchedResult = reply->places();

 

    if(m_pSearchListView)

    {

        m_pSearchListView->reload();

    }

 

}

 

 

void Geocoder::geocodeError(QGeoSearchReply::Error pReply, QString str)

{

    qDebug() << str;

 

}

 

BlackBerry Development Advisor
shaque
Posts: 246
Registered: ‎07-14-2008
My Device: Not Specified

Re: 'UnsupportedOptionError' error while Geocoding or Reverse Geocoding

Thanks. From which city, country are you trying this? I want to make sure that we have coverage for geocoding in your area.

Shadid
New Developer
dhaneshshastri
Posts: 28
Registered: ‎12-19-2012
My Device: BB 10

Re: 'UnsupportedOptionError' error while Geocoding or Reverse Geocoding

Thanks for reply,
I am trying this for Indian city 'mumbai' and 'andheri' as a locality in mumbai.