Jump to content

Member Map


Recommended Posts

Posted

Is it possible to add another table column to the Member Map application based on member id? 

I want to add core_pfields_content -> field_1

I inserted another hook but all I get is the table core_pfields_data when I try.

 

try
			{
				$groupId = $this->getMemberGroupId();

				$db = \IPS\Db::i()->select( '*', array( 'membermap_markers', 'mm' ), array( 'mm.marker_member_id=? AND mm.marker_parent_id=?', intval( $memberId ), intval( $groupId ) ) );

				$memberPfield = \IPS\core\ProfileFields\Field::load( $memberId );
				error_log(print_r($memberId,true));
				error_log(print_r($memberPfield->data,true));
				
				if ( $loadMemberdata )
				{
					$db->join( array( 'core_members', 'm' ), 'mm.marker_member_id=m.member_id' );
					$db->join( array( 'core_groups', 'g' ), 'm.member_group_id=g.g_id' );
				}
				
				$_marker = $db->first();

				if ( ! $format OR ! $loadMemberdata )
				{
					$_marker = \IPS\membermap\Markers\Markers::constructFromData( $_marker );
				}

				$marker[ $memberId . '-' . ( $format ? '1' : '0' ) ] = $_marker;
						
			}

 

Any help here would be appriciated!

Posted
17 hours ago, Thomas Hop said:

Is it possible to add another table column to the Member Map application based on member id? 

I want to add core_pfields_content -> field_1

I inserted another hook but all I get is the table core_pfields_data when I try.

 

Any help here would be appriciated!

Hi,

You can add that table as a DB join.

$db = \IPS\Db::i()->select( '*', array( 'membermap_markers', 'mm' ), array( 'mm.marker_member_id=? AND mm.marker_parent_id=?', intval( $memberId ), intval( $groupId ) ) );
$db->join( array( 'core_ofields_content', 'pc' ), 'mm.marker_member_id=pc.member_id' );

 

Posted

Yes that did add the table to $markers. When I print it inside the file: 

try
            {
                $groupId = $this->getMemberGroupId();

                $db = \IPS\Db::i()->select( '*', array( 'membermap_markers', 'mm' ), array( 'mm.marker_member_id=? AND mm.marker_parent_id=?', intval( $memberId ), intval( $groupId ) ) );

                
                if ( $loadMemberdata )
                {
                    $db->join( array( 'core_members', 'm' ), 'mm.marker_member_id=m.member_id' );
                    $db->join( array( 'core_groups', 'g' ), 'm.member_group_id=g.g_id' );
                    $db->join( array( 'core_pfields_content', 'pc' ), 'mm.marker_member_id=pc.member_id' ); 
                    
                }
                
                $_marker = $db->first();
                
            
                
                if ( ! $format OR ! $loadMemberdata )
                {
                    $_marker = \IPS\membermap\Markers\Markers::constructFromData( $_marker );
                }

                $marker[ $memberId . '-' . ( $format ? '1' : '0' ) ] = $_marker;
                        error_log(print_r($marker,true));
            }
            catch( \UnderflowException $e )
            {
                return false;
            }
        }

However when I print $markers inside the template popupContent there are only like 25 items left of the array. What am I missing here?

Knipsel1.PNG

Knipsel2.PNG

Knipsel3.PNG

Posted

Feature request.

It would be great to be able to create an IP pages custom block containing the new map markers that have been added.

Would this be possible?

Posted
On 8/6/2018 at 11:48 AM, Thomas Hop said:

Yes that did add the table to $markers. When I print it inside the file: 

However when I print $markers inside the template popupContent there are only like 25 items left of the array. What am I missing here?

Hello,

What you're missing here is that popup content is loaded with AJAX (this was done to reduce the size of the cache). See \IPS\membermap\modules\front\membermap\ajax getPopup().

You can do this in the template:

{{if $marker->container()->type == 'member'}}
	{{$profileFields = $marker->author()->contentProfileFields();}}
	{{error_log( print_r( $profileFields, 1 ) );}}
{{endif}}

 

Posted
On 8/12/2018 at 8:24 AM, Martin A. said:

Hello,

What you're missing here is that popup content is loaded with AJAX (this was done to reduce the size of the cache). See \IPS\membermap\modules\front\membermap\ajax getPopup().

You can do this in the template:


{{if $marker->container()->type == 'member'}}
	{{$profileFields = $marker->author()->contentProfileFields();}}
	{{error_log( print_r( $profileFields, 1 ) );}}
{{endif}}

 

Hey Martin,

Been a bit inactive for a few days but I have seen your post and I will check up on it when I have the time!

 

Thanks a lot!

  • 2 weeks later...
Posted
21 minutes ago, derpunker said:

Hello,

is there any reason why this extension is based on MapQuest and not on the OpenStreetMap API?

The OpenStreetMap API provides all the required information and doesn't need a registration.
https://wiki.openstreetmap.org/wiki/Nominatim
https://wiki.openstreetmap.org/wiki/Static_map_images (http://staticmap.openstreetmap.de/)

Because their Nominatim policy does not allow the kind of usage Member Map require. And when I initially developed this 3 years ago, I used a different API endpoint at MapQuest. If I remember correctly, there was also a difference in the results from OSM Nominatim and MapQuest Nominatim, where the latter was far better at getting addresses. This may of course have changed over the years.

https://operations.osmfoundation.org/policies/nominatim/

Quote
  • No heavy uses (an absolute maximum of 1 request per second).

....

  • Auto-complete search This is not yet supported by Nominatim and you must not implement such a service on the client side using the API.

And they're not happy about automated bulk requests, which the profile sync feature would violate.

 

Posted

Hi Martin,

thanks for your quick answer.
Unfortunately you are absolutly right. I read the policies / licence of the OpenStreetMap maps but not of nominatim. My fault 😞

 

Another question:
Is there a way to customize the scroll / resize behavior? The initial setMapHeight is absolutly great, but I want to disable the behavior for scrolling and resizing?
The scrolling behavior makes the map a little bit hard to use on a smartphone (e.g. getting to the community footer).

I reviewed the javascript code and found no setting. My first (and currently only) idea is to write a template hook and rename the ID of the div element.

  • 2 weeks later...
Posted
9 hours ago, Jason Back said:

Hi all. hope great. Is there anyway I can remove that overlay of different options on the map? Please see attached.

Thanks in advanced.

Jay

Add the following to your custom.css

body[data-pageapp="membermap"] .leaflet-top.leaflet-right {
	display: none;
}

 

Posted
3 hours ago, Edward Shephard said:

Hi Martin,

The 3.5.2 Membermap Zip will not open on Windows 10.

image.png.23f03d1b05e4d58f7eaf84bd6797fe76.png

Thanks very much...

 

Thanks for letting me know. I've uploaded a repacked version, as the first one was compressed in the TAR format (but named .zip),

  • 2 weeks later...
Posted

Just upgraded to the latest version. 

All looks fine, except all the pins are doubled. I have two of each slightly apart.

Any suggestions?

Posted
10 hours ago, .Ian said:

Just upgraded to the latest version. 

All looks fine, except all the pins are doubled. I have two of each slightly apart.

Any suggestions?

Are the markers duplicated in the database too? Click Browse Markers, and have a look. If they're not this is a cache issue. Rebuild both server and browser cache.

Posted (edited)
59 minutes ago, Martin A. said:

Are the markers duplicated in the database too? Click Browse Markers, and have a look. If they're not this is a cache issue. Rebuild both server and browser cache.

Show twice in browse markers. So I assume I am safe to delete from the Browse Markers section? 

Edited by .Ian
Posted
5 minutes ago, .Ian said:

Show twice in browse markers. So I assume I am safe to delete from the Browse Markers section? 

That's weird. I see that it appears as if all markers were added 12 hours ago too, is that correct? Have you done any imports or anything? What version did you upgrade from?

Yes, you can delete the duplicated markers from that section.

Posted
3 minutes ago, .Ian said:

I am going to say 3.4.6 - it was 5 years old that is all I know!  

Just ran the upgrade .

I'll delete from there.  Thanks 🙂

Oh, so you upgraded the whole software from 3.4.6 yesterday? Or you upgraded/installed Member Map and it took the marker data from a 3.4.6 database/table? That can explain any weirdness.

Posted
1 minute ago, Martin A. said:

Oh, so you upgraded the whole software from 3.4.6 yesterday? Or you upgraded/installed Member Map and it took the marker data from a 3.4.6 database/table? That can explain any weirdness.

Both. 

IPS upgraded for me, then I am upgrading the apps. 

Some are fine, others are failing big time and some have the odd issues. 

Incidentally when I ticked and unticked various people, whilst the number of items being selected didn't alter, the number to confirm that I wanted to delete was much higher.  

Posted

Hello,

After upgrading my IPS self hosted instance to 4.3.6 and member map application to the latest version 3.5.2, I'm experiencing issues with rebuilding member map cache cron job being stuck. 

608684102_ScreenShot2018-09-30at10_18_28AM.thumb.png.e423210bef1df8016900269ff8897b89.png

I did run them manually, but again it gets stuck on the next cron job. It also blocks other cron jobs to perform...

Also, my member map shows 0 markers.

Please let me know what should I check/do.

Thanks!

Ivan

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...