0

I am trying to use MapBox JS for creating a customized map with following 3 main features:

  1. Custom marker image (icon)
  2. Fly-to Location (slowly or general one either)
  3. Filtering markers

It seems that feature 1 and 2 does not fall under same JS files. Like they use different version of JS files. Please see links below for your references.

Is there anyone who tried Mapbox and used these 2 different features in one?

I also used noConflict but it does not work that way! I tried finding to create Custom marker using JS & CSS files of version v0.18.0 but it seems it does not take icon like that in the another version (v2.4.0).

Below are the 2 examples of features both uses different version of files.

https://www.mapbox.com/mapbox-gl-js/example/flyto/

https://www.mapbox.com/mapbox.js/example/v1.0.0/custom-marker/

JS and CSS Version files I found:

This is for feature 2 and 3

<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.18.0/mapbox-gl.js'></script> 
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.18.0/mapbox-gl.css' rel='stylesheet' />

This is for feature 1 - custom marker.

<script src='https://api.mapbox.com/mapbox.js/v2.4.0/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.4.0/mapbox.css' rel='stylesheet' />
  • Mapbox.js and Mapbox GL JS are completely different libraries that address the same thing. Stick to one and for your needs I'd use Mapbox.js right now. There's code documentation for the three features you cited here: https://www.mapbox.com/mapbox.js/example/v1.0.0/ – tristen May 26 '16 at 16:21
  • Hi Tristen, I used the one you just shared. But that does not have fly-to feature which is available here - https://www.mapbox.com/mapbox-gl-js/example/flyto/ I hope this can clarify what I am looking for. Thanks! – Bhargav Gandhi May 26 '16 at 17:23
  • Leaflet, which mapbox.js uses behind the scenes supports a flyTo method (appears undocumented but it's similar to panTo: http://leafletjs.com/reference.html#map-panto). You can use all the same Leaflet methods in mapbox.js as well. – tristen May 26 '16 at 19:43

0 Answers0