Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am the maintainer of the colorbox_node module. I had a request come in trying to get a map to display in a colorbox modal. I am using Drupal's built in AJAX Framework to load the data into the modal window. When rendering the map, it throws errors. I have tried to add this in the init().
if (module_exists('openlayers')) {
openlayers_include();
}
It got me a little further but it still fails out. I am just curious if these maps will load through Drupal's Built-in AJAX or not?
Comments
Comment #1
treckstar CreditAttribution: treckstar commentedWould love to know if anyone has a solution to opening a geofield map or openlayers map in a colorbox through drupal's built in ajax
+1
Comment #2
poeticdevel CreditAttribution: poeticdevel commentedAny solution to this?
Comment #3
paulhudson CreditAttribution: paulhudson commentedI'm using this to render a map form a D7 link ajax request. Seems to work fine, but I'm not passing arguments to it at the moment. Should get you setup for some more advance tweaking. :-)
Comment #4
PolComment #6
FranciscoLuz CreditAttribution: FranciscoLuz commentedI have a link in the side bar that links to a map page view.
I would like to Ajaxify it so the view is loaded into the content area without a page re-load.
I am using the Ajax link example in the Example module and saving the
$output
atajax_link_response()
with this code:PS: The snapshot code below works just fine with non OpenLayers views.
The map view does not load into the wrapper div. What am I missing?
PS: The solution on #3 did not work either.
Gist files:
- ajax_example.module
- ajax_example.misc.inc
Comment #7
PolHello,
I'm working on it, we need to implement a new element 'openlayers' to succeed to do this.
I have something working at 75% right now.
Any help is greatly appreciated.
See #1895530: Use the new 'openlayers' element..
I'm marking this as duplicated.
Comment #8
pradeep_4171 CreditAttribution: pradeep_4171 commentedHi am facing the same issue..
Could you please explain how we can load open layers map through ajax call.
Please tell me what is map name here.whether it is machine_name or title.
Comment #9
pradeep_4171 CreditAttribution: pradeep_4171 commentedHi i tried as you said.Its not working.Is their any other way to render map.I even searched their docs.nothing they provided except these two functions.
Is it possible to render map in this way?
Any help would be appreciated .
Comment #10
ErebusDG CreditAttribution: ErebusDG commentedI hate to bring this back from the dead, but I too am facing issues with displaying a node in a modal window using Colorbox Node. If the node has an OpenLayers map, the modal simply never loads the content. What's the progress on fixing this? Not sure if this belongs here or over at the ColorBox Node module issues, so I'm posting in both...
Comment #11
PolAJAX with 7.x-2.x is not possible.
For AJAX based maps, the upcoming 7.x-3.x.x version will be able to handle it, have a look at this: https://groups.drupal.org/node/440733 and the demo site: http://dev.through-my-eyes.be/