I am using a map with Google Api V3 and I am managing both events window.resize and window.orientationchange for tablets.
Whatever I do in the map like zooming or else but having in that moment certain bounds, if I rotate tablet it goes like a total mess losing zoom and bounds so I would ask you simply how it would be best way to preserve bounds and be at same center+zoom after rotate ?
Thanks in advance to all!
Cheers!
Luigi
nevermind, I solved it by myself just adding:
currentCenter = map.getCenter();
currentZoom = map.getZoom();
in orientationchange's event then setting back them on resize event and it worked to me :-)
Thanks anyway!
Cheers
Luigi
Related
i am currently trying to integrate a responsive map on my website, which i built with WIX code.
I am basically starting off with the code provided by Here maps to create an interactive map (https://developer.here.com/api-explorer/maps-js/v3.0/maps/map-at-specified-location).
I integrated the code into the html iframe and it works without any problems. But as soon as i want to define the height (for responsive matters), the map vanishes and will only return if i type in the div height in px.
I am not that much of a talent when it comes to coding but i am trying really hard to get this stuff done.
Best regards,
Daud
If you want the map to resize accordingly to container or window resize, make sure to have a handler for this:
// Window resize handler
window.addEventListener('resize', function () {
map.getViewPort().resize();
});
Note: The variable map refers to your initialized HERE map object, normally to be found where the line new H.Map(...) is called.
UPDATE:
I just found a piece of sytle.css within Here Maps that helped me out with the responive div. It seems as long as there is a certain px number added to the div, the content may only be partial responsive. Obviously somehow but still complicated...
Thanks for your interest and help, guys!
Can anyone help me with this? i dont know what is happening. but the game screen is totally messed up.. even when played
fixed by making camera Clear Flags to Skybox
So I was wondering if it was possible to animate a few single, white pixels to streak across the screen of a homepage I am building. I am a complete novice with css animations.
Basically I would love to have a few random pixels simply fly across the screen every few seconds. Is this even possible? Obviously I would have to play with the z-index to make sure they don't mess with the rest of the site.
Thanks in advance!
Kerr
I made a sample of a rotating "pixel".
JS Bin
var x=0;
$(document).ready(function(){
setInterval(function(){
$('#pixel').css({'transform' : 'rotate('+ x + 'deg)'});
x+=5;
}, 100);
});
Just to get you started. Change the pixel size and the transformation type to get the desired effect. If you want to get really fancy you can add a randomizer on the timer.
I didn't want to do it for you, just point you in the right direction. ;)
Have a problem: I want my bubbles to move in a canvas and interact(they beat with each other and change the direction of move). I learned how to move them, but cannot make them interact. Object is an image that I draw with drawImage(,,).
How can I make it?
Thank you.
Found an answer on this website:
http://gamedevelopment.tutsplus.com/tutorials/when-worlds-collide-simulating-circle-circle-collisions--gamedev-769
How can I center popup window in flex 4 ?
I have tried:
PopUpManager.addPopUp(AlertPopUp,DisplayObject(spark.components.Application), true);
PopUpManager.centerPopUp(AlertPopUp);
but it's problem with conversion Application->DisplayObject.
Please help :)
PopUpManager.addPopUp(AlertPopUp, FlexGlobals.topLevelApplication as DisplayObject, true);
PopUpManager.centerPopUp(AlertPopUp);
This link contains an example which works for me. Can you try the same? If its not working for you,post your elaborated code block to check how you have coded.
Also PopUpAnchor is worth checking if you need to position relatively to some specific component, let's say a button.