Forked from mamezito-zz/gist:c5a9bbb59e5707d4aec11d0eb5968ebf
Created
November 21, 2019 17:51
-
-
Save ajmalafif/4112a5d4d04d83b366bb205167b8253d to your computer and use it in GitHub Desktop.
Revisions
-
mamezito revised this gist
Apr 25, 2018 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,10 +5,7 @@ mapboxToken='your api key' Canvas.backgroundColor = "#000" -
mamezito created this gist
Apr 25, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,79 @@ #initial setup #modules {MapboxJS, CustomMarker, Marker, animateOnRoute} = require "mapbox-js/MapboxJS" #please use your API key here, or u ll blow my quota :) mapboxToken='pk.eyJ1IjoibWFtZXppdG8iLCJhIjoiY2pkb2p6czk1MGpqejJxbnJtZGIwaXpwZSJ9.IE7dh8a6Jvx1Zra419eF5Q' Canvas.backgroundColor = "#000" Framer.Defaults.Animation= time: 0.5 curve: Spring(0.6) originPoint=["-0.118974", "51.531978"] newPoint=["-0.089039","51.526553"] myMap = new MapboxJS accessToken: mapboxToken zoom: 12 center: originPoint pitch: 45, bearing: -17.6 hash: true #creating 3d map myMap.mapbox.on 'load', -> myMap.build3d() myMap.wrapper.parent=home #creating custom marker from framer design layer customMarker=new CustomMarker target:currentLocation point:newPoint #creating framer layer as marker originMarker=new Marker size:20 point:originPoint borderRadius:50 backgroundColor:"#fff" shadowColor:"rgba(0,0,0,0.2)" shadowBlur:10 #animating marker scaleUp = new Animation currentLocation, size: 30 options: time: 1 curve: 'ease' scaleUp.start() scaleDown = scaleUp.reverse() scaleUp.onAnimationEnd -> scaleDown.start() scaleDown.onAnimationEnd -> scaleUp.start() #building route between two points myMap.buildRoute(originPoint, newPoint, 9, "#ffcc00") Utils.delay 3, -> #animating map to location myMap.flyTo(newPoint) #animating marker to new point animateOnRoute(customMarker, originPoint, 0.01)