Hi,

I am in this situation:

I have to create a system to allow to insert some geo content like news, event etc...
So the aim is to allow this simply without the use of code but only through drupal interface.
Now I want to center the openlayer map during the creation of a node that has a wkt field ( the map ) and a select list field with a pre-setted list of location ( stored on db ) that I've populated with the following code:

$locations = array();
$locations_res = db_query('select * from localita ORDER BY Localita ASC');
while ($loc_options = db_fetch_object($locations_res)) {
$localita [$loc_options->idlocalita] = $loc_options->Localita; ( here I'd like to add the lat,lng information too in some way )
}
return $localita ;

Now I want to add the onClick event on the options or the onChange event at the select list and center the map on the lat,lng of location

Example situation:

http://www.postimage.org/image.php?v=aVnZjyJ

In the image above I am in the add blog entry page and I' d like to click on an option and center the map on that location

Is it possible?

Comments

tmcw’s picture

If you only want to be able to select locations already pre-set, then a much better solution would be to use geotaxonomy with 2.x, and assign nodes to locations via the taxonomy system. See the geotaxonomy module for more information.

zzolo’s picture

Also, if you are writing queries, make sure to wrap the table:
select * from {localita} ORDER BY Localita ASC

Though it's probably not a Drupal table, it's still good practice.

tmcw’s picture

Status: Active » Fixed

Any luck?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.