GithubHelp home page GithubHelp logo

opengis / waymark Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 5.0 61.09 MB

Waymark adds powerful mapping features to WordPress that are easy to use. Create beautiful, interactive Maps that you can customise to suit your needs.

Home Page: https://www.waymark.dev

License: GNU General Public License v2.0

PHP 73.73% CSS 9.40% JavaScript 9.80% Less 6.36% Shell 0.71%
elevation geosjon gps gpx guide kml leafletjs location map mapping

waymark's People

Contributors

morehawes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

waymark's Issues

Clustering of multiple waymark types

Hi

The new clustering fiunction is really great!

If I understood the function correctly, it is only clustering the exact same waymark type, at the moment. Would it be possible to cluster selected different waymarks?

Many thanks
Daniel

Elevation stopped working

Hi, I have noticed that my maps no longer show the Elevation - not sure when this stopped, possibly after the last update but could have been before that.

I have Elevation Profile set to Hide Everywhere in the settings and only use it in shortcodes so wonder if something has changed?

To confirm, all my maps have embedded elevation data and used to work.

Kind regards,
David

Problem on Map duplication

When duplicating a Waymark Map texts written in the Leaflet popup are not good encoded. For example this text :

Intérêt: ★★★★★☆☆☆☆☆
Commentaire: Aucun

Liens divers: Aucun

Coopération: Aucune

Is duplicated like this :

Intu00e9ru00eat: u2605u2605u2605u2605u2605u2606u2606u2606u2606u2606
Commentaire: Aucun

n

Liens pratiques: Aucunu00a0

n

Coopu00e9ration: Aucune

Website Fails to Load When Adding Multiple Cards to a Collection Using a Shortcode

Hello there,

I am experiencing an issue with your application that seems to be caused by a specific sequence of actions.

Steps to reproduce:

Add more than one card to a collection.
Load the page that contains the shortcode for the said collection.
Expected result:

The page loads correctly, displaying all the cards within the collection.

Actual result:

The entire webpage fails to load and remains blank (white screen). This behavior only occurs when multiple cards are added to a collection and that collection is called with a shortcode on a page.

You can see here

https://vantusky.info/bugreport/

There are only the Shortcode [Waymark collection_id="13"] with these two card
https://vantusky.info/reiseverlauf-und-highlights-von-unserer-vanlife-tour/

Full screen / jump to top of the page

Hello Joe. It might be very personal problem but when I open full screen map it's jumps to the top of my page. It's could be my theme problem (bootscore), but I had similar problem with glightbox interaction. One line of code in case of glightbox helped a lot (css).
https://www.northwestalps.com/2020/03/08/2020-oman-and-emirates/

This one is a page. Try to go in full screen. I will found a solution in the next days and tell you how to fix it but I'm sure you know how to do it. Once it done maybe a little blank field with some custom class can fix this issue to multiple themes.

Atm thanks.

Header / details removal.

It's once again personal, but maybe can help others too. This header with details / map name some times pretty invasive. There I think should be an option for detailed and minimal view map. Detailed is one with additional data like km and hight etc. And minimal one just map its self (no header or map name)

It's just my personal thoughts.
Thanks!.

Little Feauture request

Outstanding plugin.

Little request: I have managed to make some sort button and the map is visualized inside a bootstrap modal. Incredible. I can share my code if needed.

I have long posts and what's about to include a word to marker link? Not fly 2 marker. But instant position change when we reaching a word associated to marker? In this way maps become really more storytellish. I don't know if you have time but this could be really cool Feauture.

Thank you

Cannot get to load the elevation profile

Hey, Thanks for this awesome plugin!
I cannot enable the elevation profile, even by setting the parameter on the shortcode. Is there an instruction on adding lines that pull the elevation data?

Ascent and descent values too high

Hi

Ascent and descent values are too high, because they are calculated every 1 to 4 meters. They should be calculated in bigger walking distances. My suggestion is 10 meters.

I have adjusted the source code, which is pasted at the end of this message. Only what I have marked with DGF are changes made by me, the rest is the original. There are two functions in leaflet-elevation.js that are affected: _addData and _addPoint.

Best regards.
Daniel.


/*
* Parsing data either from GPX or GeoJSON and update the diagram data
*/
_addData: function(d) {
let geom = d && d.geometry;
let feat = d && d.type === "FeatureCollection";
let gpx = d && d._latlngs;

		if (geom) {
			switch (geom.type) {
				case 'LineString':
					this._addGeoJSONData(geom.coordinates);
					break;

				case 'MultiLineString':
					geom.coordinates.forEach(coords => this._addGeoJSONData(coords));
					break;

				default:
					console.warn('Unsopperted GeoJSON feature geometry type:' + geom.type);
			}
      //DGF if elevation difference is too small, make ascent and descent equal
      if (Math.abs(this._ascent-this._descent) <= 10)
      {
        this.track_info.descent = this.track_info.ascent;
        this._descent = this.track_info.descent;
      }
      //DGF end
		}

		if (feat) {
			d.features.forEach(feature => this._addData(feature));
		}

		if (gpx) {
			this._addGPXdata(d._latlngs);
		}
	},

/*
* Parse and push a single (x, y, z) point to current elevation profile.
*/
_addPoint: function(x, y, z) {
if (this.options.reverseCoords) {
[x, y] = [y, x];
}

		let data = this._data || [];
		let eleMax = this._maxElevation || -Infinity;
		let eleMin = this._minElevation || +Infinity;
		let dist = this._distance || 0;
    //DGF
    let elevDist = this._elevationMesurementDistance || 0;
    //DGF end
		let curr = new L.LatLng(x, y);
		let prev = data.length ? data[data.length - 1].latlng : curr;

		let delta = curr.distanceTo(prev) * this._distanceFactor;

		dist = dist + Math.round(delta / 1000 * 100000) / 100000;
    //DGF
    elevDist = elevDist + delta;
    //DGF end

    // check and fix missing elevation data on last added point
		if (!this.options.skipNullZCoords && data.length > 0) 
    {
			let prevZ = data[data.length - 1].z;
			if (isNaN(prevZ)) {
				let lastZ = this._lastValidZ;
				let currZ = z * this._heightFactor;
				if (!isNaN(lastZ) && !isNaN(currZ)) {
					prevZ = (lastZ + currZ) / 2;
				} else if (!isNaN(lastZ)) {
					prevZ = lastZ;
				} else if (!isNaN(currZ)) {
					prevZ = currZ;
				}
				if (!isNaN(prevZ)) data[data.length - 1].z = prevZ;
				else data.splice(data.length - 1, 1);
			}
		}

		z = z * this._heightFactor;

		// skip point if it has not elevation
		if (!isNaN(z)) 
    {
			eleMax = eleMax < z ? z : eleMax;
			eleMin = eleMin > z ? z : eleMin;

      // calculate new ascent or descent
      //DGF measure elevation only every 10 meters of walking distance
      if (elevDist >= 10 || isNaN(this._lastMeasuredZ))
      {
        elevDist = 0;
        let dz = z - this._lastMeasuredZ ;  //DGF
        if (dz > 0)
        {
          this.track_info.ascent  = (this.track_info.ascent || 0) + dz;  // Total Ascent
          this._ascent = this.track_info.ascent;
        }
        else if (dz < 0)
        {
          this.track_info.descent = (this.track_info.descent || 0) - dz; // Total Descent
          this._descent = this.track_info.descent;
        }
        this._lastMeasuredZ = z;  //DGF
      }
      this._elevationMesurementDistance = elevDist;
      //DGF end
      this._lastValidZ = z;
			// set up last valid z value	
		}

		data.push({
			dist: dist,
			x: x,
			y: y,
			z: z,
			latlng: curr
		});

		this._data = data;
		this._distance = dist;
		this._maxElevation = eleMax;
		this._minElevation = eleMin;
	},

Add Setting for Map Index-ability

Waymark uses the custom post type waymark_map to store Map data. Currently Maps are public and indexable by search engines (see this support topic).

Ideally this would be controlled by a Setting, so users can prevent Maps from being indexed.

Currently this is hard-coded using register_post_type in inc/Waymark_Types.php.

A work-around is to block access via robots.txt:

User-agent: *
Disallow: /map/*

Custom css class for maps.

This one is pretty easy to do I think. As I said it's very personal and could be passed by some of js custom script, but what I immagine is a optional field that wrap whole map into div with our class.

I will take aos as example that you can see here once again https://www.northwestalps.com/2020/03/08/2020-oman-and-emirates/
It's animated cause it's wrapped into aos class. Would be great if we add some different / custom classes.

Thanks.

Feauture request: Custom Markers (styling part) and some other stuff

Ok here we go with feauture requests:

  • Ability to add a custom marker without background (even if i add a custom font awesome icon it's still has background shape).
  • Ability to add a svg as custom marker (custom one svg) (maybe drag and drop).

Maps proveders free tiles list (please link a list of free tile's providers in order to simplify a option selection).

Elevation styles (those default looks kinda cartoonish, its way better to implement something like https://github.com/GIScience/Leaflet.Heightgraph/blob/master/README.md) - looks badass :)

Implement https://github.com/Leaflet/Leaflet.markercluster
In order to group several markers.

So here is a lot of things going on, but! Who knows maybe once those gonna be implemented :) thank you!

Better Map Interaction Handling

Related to #7, Waymark maps get "activated" accidentally when scrolling. Also requested here.

Currently Leaflet.Sleep is used to add a delay, however this is not an ideal solution. I think it would be nice to offer a Setting in WP Admin to adjust the delay time, or perhaps other methods to "lock" the Map.

Order of map rendering in collections

Hi Joe,

I have maps in a few collections and one of the map contain shape of the town. When I try to show collection with this shape of the town sometimes its covers other shapes from others maps. In my opinion it happens because of lack of priority attribute connected with map. Actually I workaround this behavior by removing map with shape of the town and adding new map because it seems that the newest added map is rendering as the first one when collection is rendering.

This page (from issue #1) show this problem perfectly - all circles are "under" shape of the town. I can't choose in which order maps are rendering. I can only use workaround described before.

The simplest method to resolve this problem is adding priority attribute to the maps and maps in collections should be render in order of these attributes.

Mirek

Feature Request: Ability to change elevation units on a per map basis

Hi there! We love the plugin and are using it for an upcoming website launch. Instead of just a global option for units, it would be great if we could change the unit type on the elevation profile on a per map basis. Either by adding a shortcode parameter or by setting the option on the map editor. This would allow us to show maps/routes in the same unit as the region in the map uses.

Maybe this is already a thing but I couldn't find documentation to support it. Thanks for your time!

Discussion

Hello!

I have tried several maps plugins and really appreciate your work, it's free and really complete map solution with great logic behind.

I have tried to understand plugin's logic in order to develop my custom solution because I wanna add more personal case options. One little example: once kml is converted to geojson on the map I need all my markers list in another metabox for using observer HQ assigning marker position on the map clicking a link word or javascript reach logic. Anyway.. It's just one of my little custom ideas and don't want to open suggestions for your plugin since it doesn't fit everyone's needs.

I'm not competing with your great plug btw 😂. So let's dive with request and help with your great experience.

I made my plugin now separating front and back for further adjustments. It's finally saves view and kml on the map passing saved view to the front end by shortcode.

Its pretty buggy since it's freezes a lot my Dom and overlapping my existing content (tailwind and alpine theme) maybe I have to adjust output.

But.. Now I'm kindly ask you to give it a quick look, it's pretty simple and give me some advice on performance and passing my backend adjustments to the front end logic.

Really appreciate your help.

Track direction indicator

It would be great to be able to style the track to indicate direction, for the case where it is ambiguous which way an overlapping track exits a junction.

Bug: Export only including one Marker

I'm not sure why, but I am only getting one Marker when using the Export feature on the front end 😕

I have been able to replicate locally and on waymark.dev.

This does not appear to be a file format issue - is occurring on GPX/KML/GeoJSON.

No idea when this was introduced. Will need to look in to the export logic when I get more time.

Markers show on wrong world

Markers are shown in the "wrong" world, as here:
image

It seems like the map goes on and on, you can scroll and the markers never show up on any of the duplicate worlds. Most map applications show all the map info on all the worlds, I think that makes more sense.

map_zoom option in shortcode doesn't work

Hello,
I found one particular bug linked to map_zoom option in shortcode.
This option becomes useless because of "setup_hidden_checker" function in Waymark_Map_Viewer.js (call during the init) which call the reset_data_view function which also call Waymark.map.fitBounds() and so change the zoom of the map.
I don't know if it's the desired behavior but this prevents you from using the option map_zoom in shortcodes..

Best regards,
Killian

Incorrect download content

Hello! I am using your plugin for a running community website and it's great.

We've got a setup where we have three different maps on the one page, and they display fine. However, when using the GPX download function the file contains the incorrect content. You can see here:

https://trailrunningsa.com/mt-misery-2021/#Short

Details -> Download

Is this a bug in the plugin, or are we using it incorrectly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.