How to enable animation for Geolocate Control? - mapbox

Using Mapbox GL JS ver. 1.10.1
I've already got the map working with everything, but when I click the Geolocate Control button there's no animation. It just jumps to a point so I'd like to know how to add that animation. The mapbox documentation shows the behavior I want but I can't find what I might've missed to make the animation work.
Here's what my code looks like:
var geoctrl = new mapboxgl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true
},
trackUserLocation: true
});
this.map.addControl(geoctrl);
I've tried using the exact code in the documentation, removing parameters and setting the parameters to false and there's still no animation.
Any help would be appreciated. Thanks in advance!

Finally fixed this issue. Turns out it was a windows setting for enabling animations on windows. I'm using rdp so turning off animations helped to improve the connection.
See link for more info

Related

Making viapoints draggable in Bing Maps v8

I've seen a lot of posts that say v8 does not yet support viapointPushpinOptions and I was wondering if that was still the case. What I would like to do is make viapoints draggable, but have not yet figured out how. This is the code I have...
directionsManager.setRenderOptions({
viapointPushpinOptions: { visible: false },
viapointPushpinOptions: { draggable: true }
});
Any help is much appreciated. Thanks!
The viapointPushpinOptions property is deprecated and there are no plans to add it to V8. In V8 you can use the following for waypoint customizations:
waypointPushpinOptions
firstWaypointPushpinOptions
lastWaypointPushpinOptions
That said, we are planning to add a function soon to the directions manager to get all pushpins for the route which would make it easy to go through and customize each one as much as you want. That should be in the experimental branch soon if it isn't already there and will likely be in the main release branch in a few weeks.
If you can't wait, you can always hide all waypoints, then loop through the route data and create custom pushpins for each waypoint as you see fit. Here is a sample: http://bingmapsv8samples.azurewebsites.net/#Fully%20Custom%20Waypoint%20Pushpins

Waypoints Horizontal Plug in, Can't get simple demo to work, what am I missing?

I'm trying to get this horizontal scrolling Plugin from Waypoints to work and it appears that there must be something outside of my knowledge that is missing.
Here's a codepen I made of the 1 and only example they had. It's supposed to trigger a little pop up notifier. Firstly, I'd like to see that this really works before I put anymore time/frustration into it - but I'd also like to attach an addClass or toggleClass to it.
var waypoint = new Waypoint({
element: document.getElementById('horizontal-waypoint-offset'),
handler: function(direction) {
notify('right-in-view waypoint triggered')
},
context: document.getElementById('overflow-scroll-offset'),
horizontal: true,
offset: 'right-in-view'
})
Codepen:
http://codepen.io/code-a-la-mode/pen/vOPWgM
Demo on Waypoint site:http://imakewebthings.com/waypoints/api/horizontal-option/
(ultimate use for this: I have a vimeo frame that slides in from an absolute left offscreen. I plan to have this toggle play/pause as it enters/leaves the viewport.)
I'd appreciate just seeing this work in any capacity, but if anyone wants to show off and make an example of it controlling play/pause as a vimeo (or youtube) screen slides in from off screen, I wouldn't mind AT ALL :)
The version of Waypoints you're using in that Pen is very old, 1.1.6. Creating waypoints using new Waypoint wasn't a feature until 3.0. Please try updating.

Leaflet custom map (prod. with MapTiler) not shown in version 0.7.3

My custom map which has been produced by using MapTiler 0-5 levels displays well
on leaflet 0.6.4 but is not shown on version 0.7.3. Sorry, but I'm really new in using leaflet and maps. I've googled and checked the documentation on leaflet.com but haven't got any clue of a solution. Please help.
This is a demo using 0.6.4 and html already prepared for 0.7.3.
Sorry folks, I've just found my solution after googling again with other search
criteria. So I've found thread #2776 from Jakoboud pointing me to a possible solution. This does the trick -> continuousWorld: true and my map shows up.
Here's another question: how can I keep this map centered in browser window if the shown map part is smaller in width/height than browser window? map.setMaxBounds() doesn't work, it's bouncing the small map endlessly.

iOS Safari flag for stopping page motion?

I'm curious if anyone has found a solution to disabling the default spring-loaded iOS page move when a user drags their finger across the page. For pages that are completely visible (i.e., no scrolling is necessary) the page moves and springs back into place.
I've found that disabling the "touchstart" will effectively fix this, but then it breaks all click events!?! For example:
document.addEventListener('touchstart', function(e) {
e.preventDefault();
}, false);
I've tried other touch / mouse events but no luck. I'm guessing someone out there knows a secret webkit CSS or JavaScript property which can disable this feature.
Edit: as an example of what I'm looking for, here is a similar answer for disabling other default iOS Webkit behaviors via CSS. Unfortunately these don't seem to apply to my question:
Prevent default Press but not default Drag in iOS MobileSafari?
I could have sworn I tried this, but it appears "touchmove" does the trick?
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
Update: After more testing, yes this does in fact do the trick. It seems as though one should never e.preventDefault() on 'touchstart' as that also prevents all other mouse events that follow.

iPad Flicker on auto scroll using JQuery and Scrollto plugin

I am having a bit of a weird problem with iOS platform for a page i am developing. This is the page in question. When clicking any of the case study images, the page will first unhide the required case study then scroll to it.
This works on all desktop browsers on Windows and Mac, but on the iPhone and iPad you get a horrible flicker as it scrolls down.
Not quite sure how to debug or fix this issue.
Any ideas would be of great help!
Thanks in advance,
Shadi
UPDATE 1
The latest page can be found here. Still haven't found a fix - if anyone has any idea it would be amazing!
If you need vertical scroll only, you could use {'axis':'y'} as settings to scrollTo method.
$.scrollTo(*selector*, *time*, {'axis':'y'});
Have you tried this:
$('a[href=#target]').
click(function(){
var target = $('a[name=target]');
if (target.length)
{
var top = target.offset().top;
$('html,body').animate({scrollTop: top}, 1000);
return false;
}
});
If you're just scrolling the page vertically you can replace the entire jQuery scrollTo plugin with this simple line:
$('html,body').animate({scrollTop: $("#scrollingTo").offset().top}, 1000, 'easeOutCubic');
Personally I do something like this
$('html,body').animate({scrollTop: $("#step-1").offset().top-15}, 1000, 'easeOutCubic',function(){
//do stuff
});
I found that if I try to do other js work while it's scrolling it makes the browser crunch and the animation isn't smooth. But if you use the callback it'll scroll first, then do what you need.
I put a -15 at the end of .top because I wanted to show the top edge of the div I was scrolling do, simply for aesthetic purposes. 1000 is the duration in milliseconds of the animation.
Credit goes to the poster, animate, for the tip off.
Defining {'axis':'y'} has made it right! It helped me with slideUp/Down flickering.
I'm not sure if this applies to jquery animations. But the following seems to affect CSS animations.
http://css-infos.net/property/-webkit-backface-visibility
Syntax
-webkit-backface-visibility: visibility;
Parameters
visibility
Determines whether or not the back face of a transformed element is visible. The default value is visible.
edit
Try applying it to every element and see what happens.
*{
-webkit-backface-visibility: visible;
}
and try
*{
-webkit-backface-visibility: hidden;
}
It's just a guess really...
I will also confirm Tund Do's method works flawlessly. If you need a "left/right" variation of the same thing (as I did) here it is:
$('.pg6').click(function(){
var target = $('#page6');
if (target.length)
{
var left = target.offset().left;
$('html,body').animate({scrollLeft: left}, 1000);
return false;
}
});
I would guess you could combine the two, grab the top position and chain the animates for a "left/right/up/down" animation also.
I had the same problem.
The problem is the ScrollTo plugin. Instead of using scrollto.js just use .animate with scrollTop. No more flickering in ipad/iphone.
Here it is with no flickering http://www.sneakermatic.com
You should include {axis: 'y'} in your options object. Also be sure that you have not enabled interrupt option. You can test this with {interrupt: false}.
You need to add e.preventDefault(); to each .click() call. This prevents the browser's default action, which is to stay in the same place. Hope this helps!
i.e.
$("#quicksand li, .client-list li").click(function (e) {
e.preventDefault();
...
});
I'm having the same flickering on iPhone -- even with the preventDefault and return false options of canceling the default click event. It appears that on the device it tries to go back to the top of the page before scrolling. If you have both a scrollTop and scrollLeft animation going on it really gets buggy. It's jQuery's issue.. I've seen a scrolling method with mootools that doesn't have this issue. See this page: http://melissahie.com/
Thanks nicole for giving the example with mootools.
It really seems to be a jQuery issue when trying to do a animation on BOTH scrollTop and scrollLeft.
With mootools:
var scroll = new Fx.Scroll(window, {duration: 1000, wait: false, transition: Fx.Transitions.quadInOut});
scroll.start(y, x);
it works flawlessly on iOS5!