Skip to content

Conversation

@rapotek
Copy link
Contributor

@rapotek rapotek commented Aug 19, 2020

The description below is copied and modified from recently closed PR #2182 :

This is a proposition of changes to an existing Dynamic Map, together with corresponding changes is My Neighbourhood. Because of the nature of changes, as perceived from an external user point, I named it an Interactive Map.

IMPORTANT: Because there is a bunch of changes which I consider should be validated by someone, and not only developers but OC Team and advanced users too, the whole set of changes is made to coexist with an official My Neighbourhood, but replacing it after validation should require few changes only, apart from files relocation. To assure this coexistence, some MyNeighbourhood files have been simply copied to another location, while another ones has been only slightly changed.

What is new from a user point of view:

  • A popup with marker details, showed by clicking on map marker, allows now to see not only a top-most marker, but also "move" to the next/previous marker being under the exact coordinates of the "clicked one",
  • The visibility and order of markers shown on map is consistent with currently set order and visibility of My Neighbourhood "sections" (latest caches, latest logs etc.) and changing the section order or visibility adjusts the map appearance on client side. Ordering: the most top section markers are displayed on top, the second one are next etc.
  • The visibility and order changes should apply to currently opened popup contents too.
  • If the marker belongs to a named section, the section title is shown in the top part of popup box.
  • When the mouse/cursor is moved over a row containing a particular entry, a corresponding marker is "highlighted" on the map and the "highlight" is toned down on mouse/cursor exit.
  • User can select one of supplied styles for map icons (markers): 'Simple' or 'Okapi' on My Neighbourhood configuration page. The Okapi style is more advanced, with icon size change and caption visibility behavior similar to the main map tiles, generated by OKAPI.

What is new from a developer point of view (main things):

  • All markers within MapModel are now placed within sections. When a marker does not belong to any section, it should be placed within a special, _DEFAULT_ section.
  • Each section has a corresponding layer created in map and the visibility and ordering are layers' operations.
  • DynamicMap itself (now InteractiveMap), its tools etc. have been rewritten to the more objective version, with prototyping where there is a chance for more than one instance creation.
  • InteractiveMapServices global object should be now an entry point for every external usage.
  • Markers have been rewritten to an objective, prototyped version, with inheritance introduced, and grouped within named 'marker family', where each defined family should have its own styling. A 'simple' family is using icons "computed" on server side while 'okapi' family determines current icon source basing on cache and log data passed with each marker within markerData.
  • The information passed with each marker is much more detailed, so the marker icon style computation can be more precised.
  • There is a lot of new image files for 'okapi' style, in public/images/map_markers/okapi folder, where in most cases one file maps one cache or log detailed state. The 'new' suffixed icons, defined in OKAPI but not used currently, are created too, to be compliant with full OKAPI style. I suppose, they might be useful in the future.
  • The 'okapi' style adds additional, 'background' layer with zoom dependant transparency, in a manner similar to the tiles generated by OKAPI.

Above changes should be available for validation for OCTeam, Advanced Users and System Admins under '/MyNbhInteractive' relative url.

Should work (tested) on Firefox 78, Chrome 83, Edge 44. A 'Simple' style does not show latest logs on IE 11 because of SVG icons, but current My Neighbourhood does not show them too. An 'Okapi' style should work (tested) on IE 11.

@rapotek rapotek changed the title Interactive map okapi markers Interactive map, including OKAPI-based style markers Aug 19, 2020
@kojoty
Copy link
Member

kojoty commented Feb 27, 2021

HI @rapotek

what's the status of this PR? Is this ready to test?

@rapotek
Copy link
Contributor Author

rapotek commented Feb 27, 2021

It should be, since 19th of August. But I have to recall all details coded here.

@kojoty
Copy link
Member

kojoty commented Feb 27, 2021

OK, so let me test and review what's going here..

BTW: if something works too slowly here please feel free to scream loudly :) - at least I have less time and energy for OC sometimes but usually if someone request something I try to meet the requests

@kojoty
Copy link
Member

kojoty commented May 5, 2021

@rapotek i tried to check how it works in my local env. but I'm not sure how to see such new map. Is it integrated with any existed view? If not can you just fill the example in test controller...

@rapotek
Copy link
Contributor Author

rapotek commented May 5, 2021

@kojoty It is written in the OP, but in short:

  • Log in as a OC Team member, System Admin or Advanced User
  • Go to /MyNbhInteractive page in your local env. Most of changes are visible on this page, where there is a changed map integrated with modified MyNeighbourhood controller.

If you want to see OKAPI-based style markers (more advanced than the simple ones), set a corresponding option on the main neighbourhood configuration page.

@stefopl
Copy link
Collaborator

stefopl commented Jul 10, 2025

I tested it as a regular user, not as a developer. For me, it works well. Personally, I prefer the Simple map marker style over the OKAPI style, so I set it that way in the end.

Small note: when opening the config page for the first time, the saved area point and radius are not shown.
Steps to reproduce:
Open in Incognito mode -> log in -> go to /MyNbhInteractive/config/0 -> the circle is missing. After refreshing the page, it appears.

I know that adding a menu link like My Neighbourhood Interactive under My Neighbourhood and making it visible only to the ocTeam etc. is tricky. But maybe it's possible to add buttons in the MyNeighbourhood and MyNbhInteractive views, for example next to Setup. They could be visible only for ocTeam etc. and link to each other (old <--> new version).

@rapotek
Copy link
Contributor Author

rapotek commented Jul 11, 2025

@stefopl I could not reproduce this bug with config page: tried in incognito on Firefox and Chrome, both using users with my neighbourhood defined and not - either case it worked as it should.

Anyway I am grateful that someone has looked in this PR. I had made it purposefully this way, duplicating almost the whole My Neighbourhood controlling code, because I strongly suspected that this PR would wait some time for acceptance or rejecting, therefore interactions with existing code is minimal to allow maintaining the PR free of conflicts as long as possible. The idea was, that when it is tested and accepted, replacing original My Neighbourhood would be appointed and fast. I did not suspect that the PR would be "hanging" a few years.

I added buttons to pages switch between original and interactive versions (for authorized users only), I suppose this would be what you had in mind.

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

Successfully merging this pull request may close these issues.

3 participants