Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional parameters to wpgeo_map_js_preoverlays? #67

Open
titaniumbones opened this issue Feb 9, 2015 · 1 comment
Open

additional parameters to wpgeo_map_js_preoverlays? #67

titaniumbones opened this issue Feb 9, 2015 · 1 comment

Comments

@titaniumbones
Copy link

Hi,

Is it possible to add additional parameters to functions added to the wpgeo_map_js_preoverlays hook?

I would like to permit different maps to have different image overlays; ideally, these could be added to the shortcode. If it's not possible though I can figure out something else. thanks,
Matt

@benhuson
Copy link
Owner

I don't think it's possible to pass through from the short code to that point at present.

I could possibly add an additional parameter to wpgeo_map_js_preoverlays for the main map object... e.g.

apply_filters( 'wpgeo_map_js_preoverlays', '', $map->get_js_id(), $map )

This would give you access to the Map object. Would that help?

The adjustment would have to be made in the two api files.

A map can have multiple markers (posts) so you would have to loop through to find the one you want or simply grab the first one:

$point = $map->get_point(0);

Then I think (it's been a long time since I looked at it) that you can get the post relating to the point.

$post = $point->get_arg( 'post' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants