What are Leaflet and Mapbox, and what are their differences? - api

What are Leaflet and Mapbox, and what are the differences or usages of both? What are the main differences in their APIs?

The other answer is good but a bit outdated, since Mapbox has changed significantly in two years.
Leaflet is a JavaScript API for making maps interactive on the internet. It can integrate with Mapbox, but also plenty of other tile sources, like OpenStreetMap, and other data sources, like GeoJSON overlays.
Mapbox is a company that provides map services and technology - one of those services, Map tiles, can be used in Leaflet as base maps - same as you'd use Google Map tiles in the Google Maps API. Mapbox also develops a Leaflet plugin called Mapbox.js that makes it simple to integrate with their tiles while still using all of the great functionality in Leaflet. We also support Leaflet's development, since the maintainer works here.
You can use Mapbox.js without using Mapbox tiles, and use Leaflet with Mapbox tiles - they're entirely mix-and-matchable. Mapbox.js's additions, like TileJSON and UTFGrid support, make it easier to integrate with Mapbox maps, but don't change the existing behavior of Leaflet.

Update (2014-08-22):
My answer is slightly outdated. Please refer to #tmcw's answer for an up-to-date comparison between Leaflet and MapBox.
Original Answer (2012-09-05):
You're comparing apples and oranges.
Leaflet is "just" a map API. It doesn't provide data/maps itself. Mapbox is a service to design and publish maps, where the end-result is a bunch of generated map-tiles stored in the cloud (and some json files).
Thus, for example, you may consume Mapbox maps from Leaflet. Example
Anyway, Mapbox is developed by a company called DevelopmentSeed, and they have a map API which is indeed a Leaflet competitor, called Modest Maps, although much simpler and with less functionality.
So, to sum it up:
Leaflet -> map API , no data
MapBox -> design and publish maps

You can think of
Mapbox as the GitHub of the maps
OpenStreetMaps as git
Leaftlet as a git client
and mapbox.js as the 'GitHub for Mac'
Let me try to explain more:
OpenStreetMaps (OSM) is an open source project to create/display maps & geo-data; just like git allow to create commit trees for source control. They both are software that handle data.
Mapbox is a hosting company for OSM-based maps with some more power rather than just hosting; which is the same case of GitHub for git projects.
Leaftlet is a library to enable users to display/use OSM based maps on their browsers using OSM hosting service; just like any git client is doing with git hosting services.
mapbox.js is an enhanced library to display/use maps hosted at mapbox.com, which is already based on OSM; just like the "GitHub for Mac" client is made by GitHub to provide an interface to the projects hosted on their servers.
Hopefully this clarifies your doubts.

It is an old post, here is my update.
Mapbox now is using leaflet as their official JavaScript API (I don't know what's the internal working, but... I can't visit Modest Maps at all, and Mapbox doesn't mention anything about Modest Map on their current website).

Leaflet is better I suppose. It gives you flexibility to choose your map source and edit the features as you'd like to! It's just a bit time-consuming to learn though! And the top reason: it's free!

Related

Displaying an interactive map of polygons efficiently in react native

I am currently working on a project where I want to display a map to a user on which the user can click on certain regions. The user should also be able to pan and zoom the map to be able to click on certain smaller regions.
I have formatted a shapefile with a +-500 polygons nicely into json data I can use. The data format is not relevant, I can change it to the library I'm using.
What I have tried.
First, I went for react-native-maps because it looked promising as it allows for inserting custom polygons and clicking on them. But then it turned out that I need a Google Maps API Key for just using the library even when I am not actually using Google Maps at all. I have no interest in setting up an API Key and an account on Google for something I don't use so I started looking for an alternative.
Turns out, there aren't much alternatives that support only rendering polygons and not using an API Key(Mapbox has the same issue).
I also tried the react-native-svg-pan-zoom library but this had performance issues because I couldn't use an acceptable resolution where people would not see the pixels after zooming in a bit (canvasWidth above 2000) or my app would just crash, and with values of 1500 the movement was also not smooth.
I'm a bit stuck now because I can't find any alternatives, it's just very frustrating because react-native-maps will probably do the trick but it requires an API Token for no reason.
I created this question because maybe there is still a way to not use an API Key or some other library I just couldn't find but maybe you know where to find it.

How to track usage stats of my react-native design library component?

I am building a UI component library on React-Native for consumption by multiple apps. I'd like to set up some analytics on which components from the library are used most, by which (internal) repos, etc. I see that Figma offers something close but I don't see any other solution (and we don't use Figma) - Is there anyway to do this?

KMM Library to interact with Google Analytics

I'm planing to create a KMM Library to deal with Google analytics. So we create a single source of truth to add the tags we want to track in either IOS and Android mobile apps.
When a KMM is crated for dealing with libraries like Google Analytics, do we need to add in the library both versions IOS and Android Google Analytics ?
if so, I'd appreciate an example about how to deal with two libraries one in IOS and other in Android to execute it.
just need to confirm this,
thanks.
I gave a talk about doing this, and specifically talk about analytics in it.
https://www.droidcon.com/2022/06/28/sdk-design-and-publishing-for-kotlin-multiplatform-mobile/
The website has the wrong title, BTW.
Analytics generally is just a key and a map of values. The simple way to do this is to create an analytics interface in common code, and pass in an implementation on app start from Swift (and also on Android). That way, you don't need to figure out cinterop or anything complex with dependencies and versions.

Diagram with vuejs?

I want to draw a diagram like below on the web and after drawing I want it to render the json string. I don't know what the idea is or is there any npm pulgin?
Take a look at this related and more general question about graph visualization frameworks for the web which has many different options for diagramming libraries.
Some of them work well with Vue.js but the majority has not been created specifically for VueJS. However integrating a library with Vuejs should not be a problem, as VueJS can easily be extended with third party UI components.
After all it's just JavaScript and the DOM.
Some of more elaborate solutions from the above answer show examples of how to embed a diagram editor and renderer Vuejs into your applications, but the integration is relatively straight forward, as you can see from this GitHub example showing how to integrate a graph visualization component with Vuejs.
Disclaimer: I work for the company that creates the library used in the last two links. However I do not represent my employer here on StackOverflow. You can use the same technique shown in the last link with most of the other libraries shown in the first one, too.

Evernote API in Unity3D

Since I haven't got any response on the Unity3d or Evernote forums, I'll try it here.
The last year I have worked a lot with Unity3D, mostly because the good integration with the Vuforia Augmented Reality library and the fact that publishing for multiple platforms is a piece of cake.
Now I want to show notes in an AR setting and am looking at the Evernote API for this. I couldn't find anything about using this with Unity, I can see why this is not the most common combination.
My question is: do you think I can access the Evernote API through Unity? If so, how should I do this? Or is it for this purpose perhaps wiser to make (parts of) the application with Eclipse/xCode?
Hope to hear from you!
Link to Evernote API: http://dev.evernote.com/doc/
The Evernote API has a C# SDK which you should be able to call through Unity. In terms of how to do it, you will probably need to download the SDK and follow the instructions yourself. Their github seems like a good starting point.
One thing to note is that Unity's .Net library for mobile clients are quite limited and with webplayer you will need to deal with sandbox security issues. But start with the standalone build first and see how you go