Active
Project:
Get Directions
Version:
7.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2012 at 08:15 UTC
Updated:
25 Jul 2012 at 18:03 UTC
i have different nodes with getLocations field and a parent node in relation with
those locations.
I would like to attach a view/block to the parent node with predefined getDirection map
showing locations_via for all those points.
How to do it? I saw getDirection block but I able to use it only for location from/to.
i also would like to show only the map and not the direction information.
any help?
thanks
Comments
Comment #1
hutch commentedI think the only way to get this into a block would be to put some php code into the block. You will need "PHP filter" enabled under modules > core, then add a new block in which you could insert some code, something like this:
This has not been tested.
The directions are generated by google, so you can try to hide them with $style.
You can copy function theme_getdirections_show_locations_via() to your theme's template.php, renaming it of course and do further alterations there. For instance, to detect that you are coming from the block and not a regular page you could look at the $width and $height variables which presumably are different for the block.
Comment #2
leo82 commentedthanks Hutch
it works and automatically show map without directions. I don't know how ;)
But i'm newbie of Drupal and I don't know how to keep child node ID instead of a predefined list of node
such as 1,2,3 ....
could you help me?
Comment #3
hutch commentedI'm not clear what you mean by "child node ID"
Comment #4
leo82 commentedI have a content type "trip" that has a relation with content type "stop",
trip is composed by stop (having a location)
I would like to show the complete path (composed by stop) in content type "trip"
in the map.
I have associated the block to content type trip and put your code in the block.
But i don't know how to know the child node ID (ID of the stops that compose the route)
In view I managed it with contextual filter, in this way in each trip I can show the related stop
I hope this can clarify my doubt
Comment #5
hutch commentedYou would need to write code to do the lookups in the database and that requires some expertise.