Hi Everyone,

I work for

the Department of Emergency Management here in Virginia and have been

tasked to create a map/page (that will then be implemented in an

iPhone app) that zooms in on your current location via the <script

type="text/javascript" src="http://maps.google.com/maps/api/js?

sensor=true"></script> or initialLocation.  Also we have several

GeoXML feeds that we will need to have displayed in the vicinity of

the user's current location.


We have had partial success in that I have one page that zooms in on

the initialLocation without any problems but doesn't show the GeoXML

feed.  This test page is located here:  http://www.gamecarver.com/map.html


Conversely, we have also been able to create a page that shows the

GeoXML feed and the callout windows but does not show or zoom in on

the initialLocation.  This test page can be seen here:

http://www.gamecarver.com/map3.html


So in a nut shell...we are trying very hard to come up with the page

that does the zoom in on user's current location combined with the

GeoXML feed for that zoomed in vicinity.  These pages have to be in

the "<div id="map_canvas" style="width:100%; height:100%"></div>"

format so that they display properly in the iPhone app.


I don't really understand v2 v.s. v3 but all I'm trying to do is get this
feed: https://cop.vdem.virginia.gov/gis_feeds/GeoRSS2.ashx to show up as
markers on the following code and don't know how to do it...I have commented
out my attempts.  As soon as I un-comment them I get a blank screen.  The
site is at http://www.gamecarver.com/maptest2.html ...I am really stuck and
don't know what to do:



<html>

<head>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

<title>Google Maps JavaScript API v3 Example: iPhone Geolocation</title>

<script type="text/javascript" src="
http://maps.google.com/maps/api/js?sensor=true";></script>

<script type="text/javascript">

var initialLocation;

var statepolice = new google.maps.LatLng(37.502168, -77.542212);

// var geoXml = new GGeoXml("
https://cop.vdem.virginia.gov/gis_feeds/GeoRSS2.ashx";);



function initialize() {

  var myOptions = {

    zoom: 14,

    mapTypeId: google.maps.MapTypeId.ROADMAP

  };

  var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);



  // Safari supports the W3C Geolocation method

  if(navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function(position) {

      initialLocation = new
google.maps.LatLng(position.coords.latitude,position.coords.longitude);



        var placeMarker = new google.maps.Marker({

        position: initialLocation,

        map: map,

      });

      // map.addOverlay(geoXml);


      map.setCenter(initialLocation);

    }, function() {

      handleNoGeolocation(browserSupportFlag);

    });

  } else {

    // Browser doesn't support Geolocation

    handleNoGeolocation();

  }



  function handleNoGeolocation() {

    initialLocation = statepolice;

    map.setCenter(initialLocation);

  }

}

</script>

</head>

<body style="margin:0px; padding:0px;" onload="initialize()">

  <div id="map_canvas" style="width:100%; height:100%"></div>

</body>

</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to