The following sentences are correct:
A misplaced modifier is a word, phrase or clause that is improperly separated from the word it modifies or describes. In the two sentences provided, the modifiers are correctly put next to the words they are modifying, making the sentences to have sense and not to sound confusing.
Answer: The Grand Canyon came into view as I was hiking along the trail.
Walking toward the car, I could see that i had a flat tire.