开发者

Drupal gmap: Set markers by city not clicking map

开发者 https://www.devze.com 2023-01-25 13:43 出处:网络
I have location and开发者_JAVA技巧 maps enabled so that the user can add their current location by City and Country. To have the users appear on the map they have to place a marker on their location i

I have location and开发者_JAVA技巧 maps enabled so that the user can add their current location by City and Country. To have the users appear on the map they have to place a marker on their location in the map.

Is it possible to have the markers set automatically at city level when the user sets the city?

Seems odd to ask the user to enter their location, then actually place it on the map..

Regards,

Billy


The setting you want is in admin/settings/location/geocoding . As Location providers frown on constant, high-volume geocoding requests (it takes some CPU on their part), location.module enables you to set the geocoding options for every country specifically. Add the countries you need, and the providers you prefer, and save the setting. You need the location, location search & user locations submodules activated.

Given the correct setup in admin/user/settings (scroll all down, to the collapsible "user locations"), Geocoding of user locations should now work.

@Jozzeh's link is a good read, it explains some of the caveats.


I've already commented but I've found a webpage explaining more in detail how to setup the gmap module, so users only have to enter their data instead of clicking the map as well. Click here .

Based on whatever the user has entered, when the node (or user) is saved you can work with the views-style to show the map and a (custom) marker.

Most settings about the gmap can be set at admin/settings/gmap (this is mainly to change default settings of zoomlevel)

0

精彩评论

暂无评论...
验证码 换一张
取 消