It would be great to have numbered markers, that populate the map iterativly according to view result count.

I'm sorry that I can do no more than simply politely request this as I'm no coder, hopefully someday, but not there yet.

Much thanks,

Matt

Comments

rdeboer’s picture

Assigned: Unassigned » rdeboer

Great idea!

Off the top of my head I think this will be easy to do in the marker balloons by generating a "count" field in Views.

That's not what your're asking I know... have to thing about that one a bit more...

Rik

mistermastermatt’s picture

I found this but don't quite know what to do with it.

rdeboer’s picture

Thanks Matt,
I think I may.... ;-)
Will investigate closer later...
Rik

rdeboer’s picture

Update... that code was not nearly as usable as I'd hoped...
But one thing let to another and digging a bit deeper in the LeafletJS code, I feel I can come up with something....
Not sure exactly how and where to put it though...
Rik

mistermastermatt’s picture

Great, sorry it was a bigger job than you first thought. As to how to implement, Gmap module had about 20 preconfigured numbered markers (not a marker with a 'hole' in) that could be used, and to use more than that you had to creat your own new markers and create/edit a .ini file. Anyhow, feel confident that's of no help whatsoever. Good luck, I'm eager to try anything you come up with.
Matt

rdeboer’s picture

@mistermastermatt, #5

Ok, I have a first cut. (7.x-1.x-dev). This brings it up to the level of what you describe GMap does with its pre-numbered markers.

First copy from the GMap module (or elsewhere) a set of numbered markers. Either dump them in .../sites/all/modules/ip_geoloc/markers or in some other directory. The latter is preferred, but requires you to then mention the path to that other directory on the IPGV&M configuration page.

In your View add the field "Global: View result counter".
Sort your View so that your number 1 result appears at the top, followed by number 2, 3, 4 etc...
You may opt to tick the "Exclude" box for this field.

Then in your View's Forma,t click Settings for the Map (may be Google or Leaflet, haven't tested OpenLayers yet, but should work also).
Slect "Global: View result counter" as the DIFFERENTIATOR.

Add colour associations 1 --> marker with number 1, 2 --> marker with number 2 etc.

Save and that should be it!

I'll work on the more generic solution of a "marker with a hole" or "marker with a tag" that may be filled with any field value from the VIew.
Need a bit more time for that...

Rik

mistermastermatt’s picture

Thanks Rik, it works. It is actually what I was attempting before but I ran into difficulty with using global fields. In my case this technique should suffice as I doubt a map would ever be generated with more than about 50 or so markers, so I can just do those one by one. As you say, a more general case would be great. Either one where you need to have all the markers existing somewhere and the View is able to programmatically assign the appropriate marker to the view results in a step-wise manner - as is the case currently with Gmap, but better, like you say would be to have an (im)practically infinite assignment possibility using a 'marker with a hole'.

But the best in my opinion would be to have a 'marker with a tag' that you could fill a field. That would be awesome!

For now though, your fix works fine so thanks a lot, and keep up the great work.

Matt

rdeboer’s picture

Title: Numbered markers » Numbered markers, tagged markers
Status: Active » Fixed
StatusFileSize
new166.65 KB

Well that turned out to be more laborious than I hoped.

Long story short... In the latest check-in the Views format/style "Map (Leaflet via IP Geolocation)" now has an additional fieldset (shown below) to specify a field from the View as the tagging field. So you can reuse the same marker and have a sequence number superimposed on it.

Or you can use the tag to show the title or type of the content being represented by the marker (see image in next item of this thread).

Three default CSS classes have been defined to put the number or text either just above, just below or inside the marker. As you can see from the second picture I also introduced an image of a marker with a hole (could be improved -- want to have a go?).

Let me know what you think!
Marker tags in IPGV&M

rdeboer’s picture

StatusFileSize
new1.38 MB

Further on #9, here's an image of the module in action with the node title (as a hyperlink) being used with the "tag-below-marker" CSS class.

Tagged markers

rdeboer’s picture

StatusFileSize
new210.35 KB
new1.38 MB

I've done some work on the above and have added the option to leave out the marker, so that only the tag is shown. The upper left corner of the tag coincides with the location coordinates.

This allows for more freedom in the styling of the tag. The tag in the case of the marker+tag must have its height faked to zero, which means that things like background colour and border no longer work when used in conjunction with maker images.

The implementation takes advantage of Leaflet's DivIcon, brought to my attention in this issue: #1882806: Support DivIcon for markers.

Tags without markers

Marker Tags config panel

mistermastermatt’s picture

This looks absolutely fantastic, as soon as I get back to my dev site I'll have a good explore and get back to you. Nice one!
Back soon,
Matt

rdeboer’s picture

Hi Matt,
Enjoy! Send us a screenshot of what you've created.
Rik

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.