I have a map that works up until the point that I change the width and height of this red rectangle I want to create. It doesn't matter if I put it in the initMap() function or not, it does the same thing. The map just disappears from the web page unless the example coordinates are given.
https://pastebin.com/xHkm4wUf
Could someone help me get the map to show up with the red rectangle? I want the rectangle to only encompass one building like a few hundred feet wide and long. But when I try to make any rectangle at all it disappears from my code and so does the whole map.
Here's the example rectangle from Google JS API:
https://developers.google.com/maps/documentation/javascript/examples/rectangle-simple
Why doesn't it work?
Nevermind, I solved it.
Each lat/long value of the rectangle has to be up to three decimal places and no further.
Now I have another issue but I think that can be solved.
I may make another thread for that.
So, I have this code that I am working on and I figured out how to get the rectangle feature working as mentioned in the last thread.
Now, what I want is to make the rectangle fit around a specific building. Should I just look up the coordinates for each building and do it manually? How do I make sure the rectangle only fits around the building I click on?
Here is my updated code:
https://pastebin.com/shvQXUiy
Thanks by the way.
UPDATE:
So, I have this code that I am working on and I figured out how to get the rectangle feature working on a specific building.
Now, what I want is to make the rectangle fit around a specific building that the user clicks on. Should I just look up the coordinates for each building and do it manually? I did it for one building manually and it works. How do I make sure the rectangle fits around each building I click on?
Do I just need to do a bunch of if-statements or something?
Here is my updated code:
https://codepen.io/queuemark/pen/BaoxLrB
Thanks by the way.
https://pastebin.com/xHkm4wUf
Could someone help me get the map to show up with the red rectangle? I want the rectangle to only encompass one building like a few hundred feet wide and long. But when I try to make any rectangle at all it disappears from my code and so does the whole map.
Here's the example rectangle from Google JS API:
https://developers.google.com/maps/documentation/javascript/examples/rectangle-simple
Why doesn't it work?
Nevermind, I solved it.
Each lat/long value of the rectangle has to be up to three decimal places and no further.
Now I have another issue but I think that can be solved.
I may make another thread for that.
So, I have this code that I am working on and I figured out how to get the rectangle feature working as mentioned in the last thread.
Now, what I want is to make the rectangle fit around a specific building. Should I just look up the coordinates for each building and do it manually? How do I make sure the rectangle only fits around the building I click on?
Here is my updated code:
https://pastebin.com/shvQXUiy
Thanks by the way.
UPDATE:
So, I have this code that I am working on and I figured out how to get the rectangle feature working on a specific building.
Now, what I want is to make the rectangle fit around a specific building that the user clicks on. Should I just look up the coordinates for each building and do it manually? I did it for one building manually and it works. How do I make sure the rectangle fits around each building I click on?
Do I just need to do a bunch of if-statements or something?
Here is my updated code:
https://codepen.io/queuemark/pen/BaoxLrB
Thanks by the way.