Hotspots by Waindigo [Deleted]

Still trying to figure out how to adjust the location of hotspots in the bread crumb. I am looking in /NodeHandler/Map.php -- is this the right area?

Code:
    /**
     * Renders the specified node for display in a node tree.
     *
     * @param XenForo_View $view View object doing the rendering
     * @param array $node Information about this node
     * @param array $permissions Permissions for this node
     * @param array $renderedChildren List of rendered children, [node id] =>
     *        rendered output
     * @param integer $level The level this node should be rendered at, relative
     *        to how it's to be displayed.
     *
     * @return string XenForo_Template_Abstract
     */
    public function renderNodeForTree(XenForo_View $view, array $node, array $permissions, array $renderedChildren,
        $level)
    {
        $templateLevel = ($level <= 2 ? $level : 'n');

        return $view->createTemplateObject('waindigo_node_map_level_' . $templateLevel . '_hotspots',
            array(
                'level' => $level,
                'map' => $node,
                'renderedChildren' => $renderedChildren
            ));
    } /* END renderNodeForTree */
 
Waindigo, if I were to use this: https://developers.google.com/maps/documentation/javascript/v2/overlays?csw=1#Custom_Map_Types to create a custom map image (consisting of hundreds of tiled images), where would I replace mine with the call to Google's map? I'm assuming that simply linking an url for a custom map won't work in this case. Is there a place within the code somewhere to change the call to a custom map rather than just an url to a custom image (which doesn't zoom)?
 
@Waindigo are you still working on this add-on? Anny updates planned?
The "Default to current location" option is not working for me on XenForo 1.4.2
I'm also missing a marker cluster option, if many hotspots is added in the same area this would be a nice feature to have.
 
Is this still supported / being developed further?

Jon W updated Hotspots by Waindigo with a new update entry:
Version 1.0.12 released

Apparently so. Alright then.

For my site I want my users to be able to mark several things on a map. Vaguely, their location, most are not inclined to provide more than a city and state - which is 100% fine by me. But poses a problem for Item 1 below. Second, I want to be able to add items from a few other categories, notably they will be marking event locations and approximate locations of the local clubs they belong to. It would be useful for them to be able to filter what they can see on the map ie: (show only clubs, only members, only event locations). I do not need locations pulled from user profiles, and I do need the ability for users to manually pin other locations. This is where the other available map addons fall short for my needs.

I would like to be able to use this add-on for my members, but I really can't as-is. It has some items that I see as basic usability issues and a few items that would be nice to have addressed.

Item 1: You can't have two items at the same lat and long. Which happens if two people put in 'Charleston, SC' and select 'show on map' to get the lat, long and submit. You can fake this by shifting the lat and long a little but leaving the same thing in the address, but it is a manual process and one that will just be frustrating and annoying. If the data is indexed on unique lat,long combinations this could be addressed behind the scenes by simply fiddling the lat and long by tiny amounts if a collision is detected.

Item 2: If a user just provides in an address, but doesn't select 'Show on Map' or does not move the map and pick 'Get Address from Map', the default lat,long are used rather than wherever the map is actually centered or the address they provided. Not using the address provided to do a lat,long lookup in place of the default is the bigger problem from my point of view. Most of my users will simply put in 'City, State' and hit enter. If it doesn't update the lat,long based on the selected address the result will not be as intended.

Item 3: I can't filter the map. Ideally I could filter the map by type as described above.
3b: If I pick 'show on map' from, the hotspot list, it shows me only that single item on the resultant map. An option to show the map as usual just focused on that location would be preferable.

Item 4: If the browser window resizes, the map does adjust its width nicely. However, height remains apparently constant. On a mobile platform the lack of margin to grab the page itself and scroll means you can be basically trapped just moving the map around. Ideally the height could be reduced a bit in responsive mode and maybe the width cut down a little more? This one isn't a major issue, its just an annoyance and something I can probably address on my own if needed.

Item 5: The ability to right click on the main map and pick 'add a spot here' and be taken to a prefilled form would be great. But not essential.

Items 1 and 2 are my big issues that I won't use this without. I could likely modify the add-on myself to address these, but I suspect others would benefit from you incorporating those two items as usability fixes.
3, 3b and 4 would be nice, but aren't deal breakers for me.
5 is just a 'wish-for' item
 
Jon W updated Hotspots by Waindigo with a new update entry:

Version 1.1.0 released

New features:
  • Added option to automatically create hotspots when creating a thread. The hotspot will then be linked to the created thread with a tab. This works great with event/calendar add-ons.
  • New cleaner hotspot summary, with hotspot details now appearing in sidebar to the right of the hotspot map when viewing an individual hotspot.
  • Added style properties to allow for height of maps to be reduced on responsive sites.
  • Added option to "Allow multiple hotspots at...

Read the rest of this update entry...
 
Thanks for the updates, Jon.
Have installed the latest version on our sandbox.
On our Food Challenges map, there are 33 hotspots.
With the setting of 'Default to current location' switched on, the map loaded blank except a small square top left with all the hotspots marked in the correct layout, but with the map in the wrong location.
I disabled this setting and reloaded the map. The first few tomes it loaded ok, but now I get this:
1.webp
 
Last edited:
Thanks Jon, that worked.
I had an idea that rather than (or as well as) list the hotspots in a separate tab, it might be a good idea to list them in a sidebar widget for the widget framework. A really long, scrolling list.
I tried making it work for a map using the waindigo_hotspot_map_hotspots template, but it didn't.
Is it possible?
 
Thanks for the quick response. I see that if I have multiple pins at the same location there is no way to visually see them all (makes sense - they're at the same exact location), and when I click on what one would assume is the topmost one, I get only the details of the most recent pin, which again makes sense, though isn't ideal. Is there a way to display all the pin details for a given spot? Is this something that would be addressed by treating them as a cluster of pins?
 
Thanks for the quick response. I see that if I have multiple pins at the same location there is no way to visually see them all (makes sense - they're at the same exact location), and when I click on what one would assume is the topmost one, I get only the details of the most recent pin, which again makes sense, though isn't ideal. Is there a way to display all the pin details for a given spot? Is this something that would be addressed by treating them as a cluster of pins?
As far as I know, Google Maps doesn't provide a way to deal with this situation. If you know of a way, let me know. Using the cluster option would actually stop you from seeing any information about any of them, so would actually make the situation worse.
 
As far as I know, Google Maps doesn't provide a way to deal with this situation. If you know of a way, let me know. Using the cluster option would actually stop you from seeing any information about any of them, so would actually make the situation worse.

:( I thought that might be the result of the cluster, especially after looking over the docs on it.

I have a few thoughts. Bear in mind that they are slanted towards my own particular needs and I have no idea as to whether or not they would be useful solutions from anyone else's point of view.

I do not require exact pin placement - I really just need them in the correct general area for the most part, but I do need simple to use pin placement. I also am not a big board - I have <2000 registered users and cater to a niche community that by best guess has under a thousand active participants across the world. Based on my needs, my initial approach is simply to suggest changing the coordinates in the event of a collision.

Option 1 - The Least Efficient path - Try the original coordinate, if they collide with another, select a number from a small random range - to +, roll a die and add it to the lat or long or both. Try again. Repeat until no collision. This could in theory spend a lot of time trying and failing and be very inefficient. In my case though, I am not likely to have large amounts of densely placed markers and the performance degradation would be small for me. In theory this would result in a pleasant little dispersion of markers, with low odds of collision. O(n)

Option 2 - Generate an offset at the time the hotspot is created - initially 0,0. Ask the DB for the last created offset with the desired lat,long. Offset from there with a set pattern (for example a nice spiral or something) and store the offset with lat,long. This would require a non-zero amount of rework and would create gaps when hotspots are deleted. Not very ideal, but is fixed query cost.

Option 3 -(more Option2 variant) Again store offset and adjust as need be, but instead of asking the DB for the last one, ask it how many collisions. Create an offset based on that. Problem: Introduces possible collisions after deletions.

2 and 3 both could in theory create collisions with other preexisting hotspots that don't have the same original location.

Option 4 - take the initially provided lat,long and shift it slightly whether there is a collision or not - and don't bother checking --- this relies on the idea that density in an area is low and randomly generated adjustments in two dimensions are unlikely to collide and in the event of a collision a moderator or the member can shift the pin manually when it is noticed. This is probably the simplest approach but results in every pin being inaccurate.

Option 4 could be combined with Option 1 for a 'Try once, if you fail, randomly adjust and save it but don't bother checking for another collision' approach - this would still be finite time and in my situation I believe produce acceptable results. Lacking a better solution, I am likely to go make this modification and see how it pans out.
 
I had a few minutes, so I tossed together the Option 4 + 1 hybrid. The coordinate alteration is in the range of +/- 0.0015. I'm pretty happy with the result.

BTW, the sizing fix for the responsive stuff is great, thanks!
 
How awesome will be Hotspots supporting Resource Events?

Examples:
- on a Resource Event will be possibile to embed the location(s) of the event from Hotsposts
- on Hotspots you can see all the events' pins and clicking it view some info and the link to the Resource Event
 
Top Bottom