Jump to content

SOLVED/COMPLETE: Using Geomaps in my own component


Christopher Ambler

Recommended Posts

Okay, so I've looked through the code for the geomap addon, and I'm pretty sure I understand how it works. I see that it's implemented as an S2 component, and S2 handles its proper instantiation.

 

What I'm not able to find is the codepath for actually creating and calling into the component. Specifically, I see no new statement for a class of GeomapsComponent(), so I presume it must be created via a programmatic name. I also don't see any call to the startup() function, so I'm going to have to presume that it, too, is called as part of a different code path.

 

Here's what I'm trying to do:

 

On the creation page for a listing, when this addon is enabled, there is a section for location information that lets the user put in an address and then click on a "map it" button to fill in the latitude and longitude.

 

I'd like to be able to call into this plugin from my own custom application so that I can use this functionality. Exactly this functionality, in fact! They give a location, click "map it," and I can get back the latitude and longitude.

 

It seems to be that what I want to be able to do is instantiate this plugin, call its display codepath, and then extract the value from the two elements for latitude and longitude when the form is submitted. The last part seems obvious - it's simply the call that gets this plugin on the page that I'm not finding.

 

Doing it this way would also mean that any upgrades or enhancements done to this add-on would be picked up by my component without my having to cannibalize the code each time. Plus, if it matters, once I release my component, it would be an incentive for any of my users to buy JReviews. :-) Doing it as a call into the plug-in means I don't have to (nor could I) redistribute the JReviews code. It's the right way to do it.

 

Any help would be GREATLY appreciated!

Link to comment
×
×
  • Create New...