Control InfoWin/map-center with javascript

  • rallisf1
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 11 months ago #6628 by rallisf1
Firstly, congratulations on your work; i believe this is the best extension of its kind.

I have created a single map with about a dozen placemarks. I load the map under an article through the ZH module.

What i want to do is have custom placemark links inside my article and when i click certain words (imagine an article with place references inside) i want the map to center itself on the corresponding placemark and open its InfoWin.

I tried to do this with jQuery (triggering click on the markers by their index() value) but this is very messy and as the map is zooming in and out it stops working.

I spent all afternoun trying to figure out how to use "Hidden Attributes for customization" but i just couldn't figure out where to call $currentmarker->attribute1 in the php file (i suppose it is somewhere in display_map_data.php)

If i get each marker to have its own custom attribute then it is easy for me. Maybe you know a better way to do what i want.

Can you help me? Thanks in advance!

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #6633 by Dima
Hi, thanks.

Today only component call can support external placemark list.
But good news is - now all my extensions (component, plugin and module) have common code, therefore I can add new option on module (like it done for component)

If you look and menu item for map you'll see parameter "Enable Support External Link to Placemark"

I think it is not hard to enable this feature in module. It needs a few days for alter code and check correct processing in module call.

Don't forget support my developments: post review in JED , donate , help with translation ;)
The following user(s) said Thank You: rallisf1

Please Log in or Create an account to join the conversation.

  • rallisf1
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 11 months ago #6637 by rallisf1
Replied by rallisf1 on topic Control InfoWin/map-center with javascript
Nice, i didn't know i have more options by calling the component. I will do this the other way around for now (call the component and put article in module position above it).

Let me know when you have updated the module.

Cheers!

Please Log in or Create an account to join the conversation.

  • rallisf1
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 11 months ago #6654 by rallisf1
Replied by rallisf1 on topic Control InfoWin/map-center with javascript
I am still facing a problem with this. The problem is that once the map zooms in on a single placemark the non visible placemarks disappear from the DOM and are no longer clickable.

I suspect this isn't going to be fixed so how about a piece of javascript to zoom out the map (ideally center it also)

another idea is to fill my map with a bunch of hidden placemarks with a small zoom value and click those before clicking the real ones

e.g. click dummy placemark to zoom out, setTimeout(click real placemark, 500)

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #6655 by Dima
Hi

Check update from extension manager

Look at zhuk.cc/2015/05/19/zh-googlemap-module-s...links-to-placemarks/

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

  • rallisf1
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 11 months ago #6656 by rallisf1
Replied by rallisf1 on topic Control InfoWin/map-center with javascript
omg i didn't know of the PlacemarkByIDShow function!

you rock dude!!!

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds

Donate


Go to top