How do I add the 'Map link' (which links to google maps) into my View block. I can add fields for street, country, postcode etc., but I can't see how to add the map link as a field.

Is it possible? I'm using Views version 7.x-3.0-rc1

FIELDS
Location: Name (Name)
Location: Street (Street)
Location: City (City)
Location: Postal Code (Postal Code)
Location: Country (Country)

Comments

itaces’s picture

Any answers/explanations on this?

why can't you choose "Map link" as a field to add to a view in D7 views?

Thanks.

pipep’s picture

I would try this module...

FranCarstens’s picture

Issue summary: View changes

I would like this too. I'm not looking to add a map to my view, just a link to maps.google.com's page of the location (as seen in the node view of "location.module"). Is this possible?

FranCarstens’s picture

I was able to create this link in views by doing the following:

  1. Load and Exclude from Display the following fields:
    • Location: Name
    • Location: Street
    • Location: City
    • Location: Postal Code
    • Location: Province
    • Location: Country
  2. Create a "Global: Custom Text" field with the following settings:
    • Text: Map Link (or your preference
    • Rewrite Results: Output this field as a link
      • Link Path:
        https://www.google.com/maps/search/[name]+[street]+[city]+[postal_code]+[province]+[country] 

        (Using replacement patterns)

      • External server URL: Yes
      • Transform Case: Lowercase

That should do it.

ralliaf’s picture

You can add the field Location: Address and hide from display all fields except from Map link.

legolasbo’s picture

Status: Active » Closed (outdated)

Closing support tickets that have been inactive for over a year to clean up the issue queue. Please reopen if this is still an issue.

liquidcms’s picture

odd that there is no API call to create the map link.

liquidcms’s picture

if you have the location LID, then you can use this in a custom php block:

$loc = location_load_location(1294);
$link = location_map_link($loc);