Skip Navigation

[Resolved] Map Initiation – just need basic information

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 6 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#650630

Hello,

Note, I am not looking for any type of code solution or creation - simply trying to determine which file I need to reference to solve my own problem.

I have a plugin which applies a simple Google Map Overlay based on providing a small bit of information - which I found easily for the front end map output: 'self.maps[ thiz.map ]' , based on information found in 'wpv_addon_maps.js' (i.e. self.maps [ thiz.map ] = new self.api.Map...) - and with that, it works fine.

I am simply trying to determine where the similar JS call exists for the Admin side (Address Field Map) so I can direct the plugin at that as well. I expected it to be in the JS folder of the toolset-maps plugin but I am not seeing where this occurs so that I can extract the reference I need for the plugin.

Even just knowing which file to target would be a big help.

Thank you

#651849

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-04-12 at 08.21.12.png

Hi Arthur

I'm not entirely surely what you need, but on the backend there are 4 JS files loaded relating to the Maps extension, as you can see in the screenshot, all in the folder toolset-maps/resources/js/

Note that if you want to refer to the map object once created you can do so with:

WPViews.view_addon_maps.get_map( map_id );

That may help.

#652786

Hello,

Yes, it is there that I was able to locate the information for the front end maps, so that the plugin is working with the front end.

But now I am trying to find it for the map being generated in the ADMIN, such as when in the process of creating a post - specifically, in the "Mapping Address" Field where you have the address / lat / long on the left, and the preview / placement map on the right.

I had suspected that 'wpv_addon_maps_settings.js' was responsible for driving that but this doesn't seem to be the case - since this map is on the admin side I realize I may be looking in the wrong place. if I can just determine which JS file is responsible for initializing that particular map for the Mapping Address field I should be able to locate the reference I need.

#655877

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Arthur

I'm still not sure what exactly it is you are looking for to provide to your other plugin, but I quickly scanned through the four JS files provided by Toolset Maps, and it looks like wpv_addon_maps_editor.js is the one that adds the map on the backend post edit screens.

You should look there for what you need.

#659970

Hi thanks,

I am just looking for the map reference.

For the front-end map display, I located it in 'wpv_addon_maps.js' where it calls:

self.maps [ thiz.map ] = new self.api.Map ... 

and so I simply entered into the field:

self.maps[ thiz.map ]

...and voila, it works great.

In the file you are referencing, I see where it is initiating the Geocoder service, and Places Autocomplete, etc. but not the map itself.

But if you are stating it is there, I will have to revisit and try some options.

If you have any suggested reference from whatever it is your are seeing - or maybe just a line number where you feel this is occurring - of course you would become my best friend (Lol)!!!

Thanks very much for your kind efforts.

#674292

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I have asked my colleagues, and I'll let you know if I get any helpful replies.

In the meantime, I'm wondering what version of Toolset Maps you are using, because the current version doesn't contain the code you refer to.

Line 417 of wpv_addon_maps.js uses self.maps[ map.map ]. I can't find self.maps[ thiz.map ] anywhere.

#677549

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Arthur

The lead developer replied and said that there is no public API for Maps in the backend, and instructed me that there was nothing I could recommend to you.

We can't stop you poking around in the source code, but we can't encourage it, because if I recommend a particular line of code to you it means we would then be obliged not to change it or provide backwards compatibility for it if we did, and that is something we will only do for the public APIs.

So I can't help you more, I'm afraid, I hope you understand.