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
Comment #1
tmcw CreditAttribution: tmcw commentedIf 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.
Comment #2
zzolo CreditAttribution: zzolo commentedAlso, 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.
Comment #3
tmcw CreditAttribution: tmcw commentedAny luck?