Michi
Michi

Reputation: 1

click marker into a map instead of fill out the addressfield

I am using the openlayers addressfield, geocode and geofield modules in Drupal7 to let the users create content with relevant geodata. But for some content there is no streetname available. So i would like to have a prezoomed maparea where the user can click in and flag the right position, instead of typing in the addressfield.

I tried to use the geofield with the "Openlayers Widget Map", but it's not exactly what i need.

Does anybody know how to use the modules for that? Is there a tutorial for that?

Kind Regards Michi


thx for answering!

Yes, in theory it works. I tried it befor with the geofield module. And yes, i could see the map in the contenttype form while creating a node.

But i havn't found a way to prezoom the map into relevant places (or use the geolocate bevahior for that) or change the marker style for that geofield map. The only mapstyle i can choose in the contenttype field setting is the "geofield widget map". So i have no choice to use an individual prezoomed map with own marker styles. Changing the "OpenLayers Default Map" in the openlayers settings makes no difference. So maybe i've overlooked something to customize the geofield, but the module has no configuration link. So without some more configurations, the module is not practicable for users to flag a node with geofield.

Any other ideas or informations?

Upvotes: 0

Views: 1666

Answers (1)

Boriana Ditcheva
Boriana Ditcheva

Reputation: 2015

You can do this with the Geofield module: http://drupal.org/project/geofield

When you enable that module, you can add a Geofield field on your content type and set the widget to be an 'Openlayers Map'... the geofield field lets you input geographic information in a variety of ways, but just clicking on a map is one way. It probably uses the default zoom and center you have saved for your Openlayers map.

Try that out and let us know if it worked!!

Here are the options for entering in address information via Geofield:

enter image description here

Upvotes: 2

Related Questions