3

I don't know if this is possible already, but I keep wanting to "control the camera" as if I were playing a top-down video game or something, where it slowly scrolls and rotates the entire map based on how much you press left and right, etc. Simply allowing you to "walk around" the 2D map as if it were an older video game.

Is this already supported as some kind of "walk mode" that you can enable or something?

Although simple to implement for an expert, it's a major ordeal for me to accomplish on my own. I think this would be much used if it existed, although I'm of course waiting for the full-3D environments that Google Maps API is supposed to give people now... but until then.

I haven't heard a peep from Google after they released that video.

  • I don't have time to actually test this out but i would suggest adding a listener on the map to listen for keystrokes, and if the detected keycode is from an arrow key, get the current map centre coordinates, and call the panTo() method, using those coords and add/subtract a small amount to/from them in accordance with the arrow key that was pressed (left and down would be subtraction, right and up would be addition). – wfgeo Apr 3 '18 at 14:25
  • @1saac I think you should add that as an answer. – PolyGeo Jul 24 '18 at 21:45
1

I would suggest adding a listener on the map to listen for keystrokes, and if the detected keycode is from an arrow key, get the current map centre coordinates, and call the panTo() method, using those coords and add/subtract a small amount to/from them in accordance with the arrow key that was pressed (left and down would be subtraction, right and up would be addition).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.