Hello,
I couldn’t find yet anybody asking for this question on the forum so I am posting this regarding the EGMap extension and reverse geocoding.
Currently I can’t even get the reverse geocoding example working and I suspect the hang happens somewhere around the point where the webservice is called. In here…
$geocoded_address->geocode($gMap->getGMapClient());
I am running an apache server locally and the webapp is on localhost. Other examples of showing the map and including markers on it work OK but when it comes to reverse geocoding the browser just hangs to the point where the getGMapClient is called. Here’s the example code I used…
Yii::import(‘site.common.components.egmap.*’);
$gMap = new EGMap();
$gMap->setWidth(500);
$gMap->setHeight(400);
$gMap->zoom = 5;
$sample_address = ‘Czech Republic, Prague, Olivova’;
// Create geocoded address
$geocoded_address = new EGMapGeocodedAddress($sample_address);
$geocoded_address->geocode($gMap->getGMapClient());
// Center the map on geocoded address
$gMap->setCenter($geocoded_address->getLat(), $geocoded_address->getLng());
// Add marker on geocoded address
$gMap->addMarker(
new EGMapMarker($geocoded_address->getLat(), $geocoded_address->getLng())
);
$gMap->renderMap();
Any help appreciated!
Edit: I am able to use reverse geocoding using the jquery-gmap extension. What could still go wrong with EGMap…?