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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Contributor
gavoh
Posts: 23
Registered: ‎10-08-2012
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

Please use plain text.