The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Google Map Overlays
Sorryboss
post Sep 2 2012, 09:29 PM
Post #1


Newbie
*

Group: Members
Posts: 16
Joined: 2-September 12
Member No.: 17,724



Hi there,

I'm trying to update the map overlays on my website (It's been pretty much dormant for 2 years), and the new overlays are not working at all. Updates to existing ones (sometimes) work. The site has a Google map nested in it, which users can double click on and drag around to zoom and navigate. They can also type their address into a search bar and look to see if their house has pipes nearby.

All the overlays do is draw blue or red lines over the top of the map to indicate pipe locations.


Basically the set up is:

The location of the overlay is declared:
CODE
var npipemap = new GLatLngBounds(new GLatLng(-XX.XX,XXX.X), new GLatLng(-XX.X,XXX.X));


Zoom level is checked:
CODE
  function checkBounds() {
  var zoomlevel = map.getZoom();
  if (zoomlevel > 13)


Then each different overlay has its own few lines of code, like this:
CODE
if (npipemap.contains(map.getCenter())) {
    map.clearOverlays()
    map.addOverlay(new GGeoXml("http://www.pipelayingwebsite.com.au/images/maps/pipemap_1.kmz"));          
    map.addOverlay(new GGeoXml("http://www.pipelayingwebsite.com.au/images/maps/pipemap_2.kmz"));          
    return;
   }


I basically copy + pasted the above code to create a new overlay, changing the file names to match. This new overlay will not show up at all.

There is also this, which I think defines the version of google maps it's using(?):
CODE
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAB5Fo4svCflz5b6uZXzxksBQkk_vlWo8oYWYx10FB3t-kwb3KlxSgMLj3jTw_jrZ5n4rETVUMn0Oxeg" type="text/javascript"></script>
<script type="text/javascript">


Another problem I am having is, once the pipe overlay actually displays, if you move the map it disappears and won't come back for a while (30 seconds+), but this is far less important than just getting the new overlays working.



I have been asked to make this as confidential as possible, which is why the co ordinates and site/file names have been changed.

Hopefully this all makes sense,

Thanks,

Sorryboss
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Sorryboss
post Sep 5 2012, 07:19 PM
Post #2


Newbie
*

Group: Members
Posts: 16
Joined: 2-September 12
Member No.: 17,724



As an update to this: The overlays never work. I made a bit of a mistake thinking they did, because my code was pointing back to the live site instead of my offline site...

Basically I want to be able to stick a new .kmz file into the maps folder, add a new line into the code that points to that map, app the coordinates in and then be able to browse to those coords and see the pipes.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th May 2013 - 07:54 AM