sphericalmercator | Spherical Mercator math in Javascript | Map library
kandi X-RAY | sphericalmercator Summary
kandi X-RAY | sphericalmercator Summary
sphericalmercator provides projection math for converting between mercator meters, screen pixels (of 256x256 or configurable-size tiles), and latitude/longitude. Compatible with nodejs packages and in-browser.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sphericalmercator
sphericalmercator Key Features
sphericalmercator Examples and Code Snippets
Community Discussions
Trending Discussions on sphericalmercator
QUESTION
I have been looking to get back working on a JS Everest Flight Sim. Originally I had tried to create my own elevation mesh and tiles using DEM elevation data and mapping it to vertices Z axis.
I decided using Mapbox RGB tiles for elevation data would be a better approach. Unfortunately I can't seem to get it to work. The Omaha Nebraska doc example works but now the Mt. Everest tile.
I've brought the issue up here as well: https://github.com/mapbox/sphericalmercator/issues/43 Perhaps someone from Mapbox can offer me some insights :)
...ANSWER
Answered 2021-Apr-14 at 04:59I think you are using the wrong library to convert lon, lat to tile x, y. The documentation mentions some libraries, including this one:
tilebelt: a set of JavaScript utilities for requesting and working with tiles.
Example:
QUESTION
my intention is to display a gps track and the corresponding trackpoints with Mapsui (wpf) on a map. I tried the following code. The result is that the blue linestring is displayed (ok), the red track points (ok) but for any reason you see white track points which are very large and I do not want them to appear at the map and I do not know where the white dots are coming from. Any idea what I am doing wrong?
...ANSWER
Answered 2020-Nov-27 at 10:34so for everyone who is interest in the answer
QUESTION
I am writing a app where you can show your location on the screen. Everything works fine but the map is just one pixel line high. Is there a solution for this?
...ANSWER
Answered 2020-Jun-26 at 14:14Everything works fine but the map is just one pixel line high. Is there a solution for this?
To use the Mapsui, it's not necessary to create a custom mapsui view. Add the declare line code to the xaml file, the view will be available.
Check the code:
QUESTION
I'm still fairly new to Visual Studio/Xamarin but I had a simple OpenStreetMap sample running awhile ago for Android that did display a map but that doesn't seem to display map anymore though I haven't changed the code for this sample in awhile as far as I recall. I'm not sure if some Visual Studio/Xamarin or MacOS update might have caused it to not work anymore.
I'm using Visual Studio for Mac community 8.4.4 (build 91) on macOS Mojava 10.14.6 and the following Packages:
- Mapsui 1.4.8
- OsmSharp 6.2.0
- Xamarin.Android.Support.Core.Utils 28.0.0.1
- Xamarin.Android.Support.CustomTabs 28.0.0.1
- Xamarin.Android.Support.Design 28.0.0.1
- Xamarin.Essentials 1.2.0
My MainActivity.cs
file contains the following code:
ANSWER
Answered 2020-Feb-13 at 13:18The version of BruTile used in Mapsui 1.4.8 did not send the user-agent as part of it's request and at some point the openstreetmap server started blocking requests for this reason.
As a workaround you could create a custom ITileSource as described here by Matt Schneeberger: https://github.com/Mapsui/Mapsui/issues/668#issuecomment-497947690
QUESTION
I am trying to set up a web server in Node.js that serves vector tiles to be displayed in a browser using MapboxGL JS. The data for the vector tiles is stored in a PostGIS database.
I receive a geojson file and process it createing a database with next sentence: CREATE TABLE IF NOT EXISTS countries ( table_id SERIAL, properties jsonb not null, geom geometry(GeometryZ,4326), primary key (table_id));
My current set up seems to going in the right direction, as I can see vector tiles being loaded and displayed in the browser. However the rendered result is incorrect (this is a screenshot of a section of my map):
What is rendering incorrectly???
Here is the code:
...ANSWER
Answered 2019-Dec-18 at 02:25Evidently, you have a projection problem. It looks like the black overlay is more stretched vertically towards the poles than the basemap, as well as being shifted northwards.
It's a bit hard to say for sure where the problem lies, as you haven't includede the client side code. It's possible the vector tiles are perfectly represented within the EPSG:3857 projection, but you're overlaying them on a slightly different projection (EPSG:3785 perhaps).
The fact that you've disabled ST_AsMVTGeom
s clip_geom
parameter also suggests that your bounding box wasn't calculated correctly, and you were working around that.
You may get better answers posting the question at gis.stackexchange.com
QUESTION
How do I create a new transformation class compatible with MapSui.Projections.ITransformation interface using ProjNet4GeoAPI that reads the source coordindate system from a prj file.
From Mapsui source code, there is a MinimalTransformation that implements ITransformation interface to convert between SphericalMercator and WGS84.
From Mapsui documentation : The out of the box Mapsui support for projections is limited. The MinimalProjection class only projects between SphericalMercator (EPSG:3857) and WGS84 (EPSG:4326). It is however possible to create your own Transformation. You need to implement the ITransformation interface. Within this implementation you need to use some other projection library. A recommended one is ProjNet4GeoAPI.
I can create a working the transformation class with ProjNet4GeoAPI but it implements GeoAPI.CoordinateSystems.Transformations.ICoordinateTransformation not Mapsui.Projection.ITransformation
...ANSWER
Answered 2019-Mar-21 at 08:58You already did the hard part which is to get the ProjNet4GeoAPI projection right.
For your own projection class you could copy the MinimalTransformation class. Then add dictionary entries for the from and to projections to your custom projection.
QUESTION
I have an array with some coords
...ANSWER
Answered 2018-Nov-27 at 00:08coords
contains strings like:
"45.461,9.177"
but it looks like L.CircleMarker
is expecting an array. You can split the strings on the comma to give CircleMarker
an array of values with:
QUESTION
I have a NodeJS application using Hapi on version 17 which consumes a web service which returns an image of a map, however, when run the code below I get the following error:
...ANSWER
Answered 2018-Feb-23 at 20:56If you look at the hapi docs for lifecycle methods it states:
Each lifecycle method must return a value or a promise that resolves into a value.
So, just return something in your handler:
QUESTION
I am using Australian government map data found here: Victoria, Australia locality data, which is provided in the EPSG4326 projection.
When I try to use the data with leaflet, of course, my data is a bit distorted due to the earth's curvature - so my data is not represented properly on the screen because the maps are using a different projection to my data.
I have tried to force the map to use EPSG4326 by setting it in Map options and also in the TileLayer, as shown here:
...ANSWER
Answered 2017-Nov-28 at 12:02Your GeoJSON data is encoded in WGS84, which can be simply plotted on EPSG4326, but is also the expected input for EPSG3857 (Web Mercator).
From that Wikipedia article:
While the Web Mercator's formulas are for the spherical form of the Mercator, geographical coordinates are required to be in the WGS 84 ellipsoidal datum.
Therefore, you do not have to change anything to plot your data onto a regular Leaflet map, using regular tiles (from OSM or Mapbox, which provide tiles only for EPSG3857).
QUESTION
I am trying to get the corner of a map with a given width, height and zoom level.
Is there any way to calculate it without using GoogleMaps .getBounds()
?
I tried sphericalmercator but couldn't get those marker moved into the corners:
...ANSWER
Answered 2017-Jun-30 at 09:33Managed to get it working with viewport-mercator-project:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sphericalmercator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page