sphericalmercator | Spherical Mercator math in Javascript | Map library

 by   mapbox JavaScript Version: v1.0.3 License: BSD-3-Clause

kandi X-RAY | sphericalmercator Summary

kandi X-RAY | sphericalmercator Summary

sphericalmercator is a JavaScript library typically used in Geo, Map applications. sphericalmercator has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i @mapbox/sphericalmercator' or download it from GitHub, npm.

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

            kandi-support Support

              sphericalmercator has a low active ecosystem.
              It has 216 star(s) with 44 fork(s). There are 88 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 6 open issues and 12 have been closed. On average issues are closed in 327 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of sphericalmercator is v1.0.3

            kandi-Quality Quality

              sphericalmercator has 0 bugs and 0 code smells.

            kandi-Security Security

              sphericalmercator has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sphericalmercator code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sphericalmercator is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sphericalmercator releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sphericalmercator
            Get all kandi verified functions for this library.

            sphericalmercator Key Features

            No Key Features are available at this moment for sphericalmercator.

            sphericalmercator Examples and Code Snippets

            No Code Snippets are available at this moment for sphericalmercator.

            Community Discussions

            QUESTION

            Cannot get Mt.Everest RGB Tile Data from Mapbox (Not Found)
            Asked 2021-Apr-14 at 04:59

            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:59

            I 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:

            Source https://stackoverflow.com/questions/67084425

            QUESTION

            Display Linestring and Trackpoints with Mapsui
            Asked 2020-Nov-27 at 10:34

            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:34

            so for everyone who is interest in the answer

            Source https://stackoverflow.com/questions/65033623

            QUESTION

            MapsUI 1.4.0 Xamarin differemce versions Newtonsoft.Json
            Asked 2020-Jun-26 at 14:14

            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:14

            Everything 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:

            Source https://stackoverflow.com/questions/62592633

            QUESTION

            OpenStreetMap is not showing anymore using OsmSharp and Mapsui
            Asked 2020-Feb-13 at 13:18

            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:18

            The 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

            Source https://stackoverflow.com/questions/60076403

            QUESTION

            Why Server Vector Tiles for MapboxGL Client rendered incorrectly
            Asked 2019-Dec-18 at 02:25

            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:25

            Evidently, 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_AsMVTGeoms 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

            Source https://stackoverflow.com/questions/59377570

            QUESTION

            Using Mapsui, how do I create a new transformation class for coordinate system read from shapefile prj file?
            Asked 2019-Mar-21 at 18:03

            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:58

            You 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.

            Source https://stackoverflow.com/questions/55272284

            QUESTION

            How to get coordinates from array?
            Asked 2018-Nov-27 at 00:08

            I have an array with some coords

            ...

            ANSWER

            Answered 2018-Nov-27 at 00:08

            coords 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:

            Source https://stackoverflow.com/questions/53490732

            QUESTION

            Hapi error: handler method did not return a value, a promise, or thrown an error
            Asked 2018-Feb-28 at 15:37

            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:56

            If 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:

            Source https://stackoverflow.com/questions/48953596

            QUESTION

            Leafletjs How to project EPSG4326 points to the leaflet default
            Asked 2017-Nov-28 at 12:02

            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:02

            Your 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).

            Source https://stackoverflow.com/questions/47529832

            QUESTION

            Maps - Pixel to Latitude Longitude calculation
            Asked 2017-Jun-30 at 09:33

            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:33

            Managed to get it working with viewport-mercator-project:

            Source https://stackoverflow.com/questions/44836152

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sphericalmercator

            You can install using 'npm i @mapbox/sphericalmercator' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mapbox/sphericalmercator.git

          • CLI

            gh repo clone mapbox/sphericalmercator

          • sshUrl

            git@github.com:mapbox/sphericalmercator.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link