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
Contributor
Posts: 23
Registered: ‎10-08-2012
My Device: 9800
My Carrier: vodafone

Problem in "Reverse Geocode"

Hi, I am using Cascades, and want to get Address from the a Coordinates, 

I used this code:

QStringList serviceProviders =
				QGeoServiceProvider::availableServiceProviders();
		QGeoSearchManager* searchManager;
		if (serviceProviders.size()) { //serviceProviders.size()=1
			QGeoServiceProvider* serviceProvider = new QGeoServiceProvider(
					serviceProviders.at(0));
			searchManager = serviceProvider->searchManager();
			bool res = connect(searchManager,
					SIGNAL(finished(QGeoSearchReply*)), this,
					SLOT(searchFinished(QGeoSearchReply*)));
			searchManager->reverseGeocode(info.coordinate());
		}

 and 

void IndexPage::searchFinished(QGeoSearchReply *reply) {
	QList<QGeoPlace> places = reply->places();

	if (places.size() > 0) //Return 0
		qDebug() << places.at(0).address().city();
}

void IndexPage::searchError(QGeoSearchReply *reply,
		QGeoSearchReply::Error error, QString errorString) {
	qDebug() << errorString;
}

 

My problem is:

"places.size() " in searchFinished method return 0, and I cant get the place info

 

Note:

I test my code on the simulator and I using NDK version 10_0_9_1673

 

Please help

 

Thanks

Highlighted
New Contributor
Posts: 2
Registered: ‎07-24-2013
My Device: z10
My Carrier: company

Re: Problem in "Reverse Geocode"

Having same problem