[OpenLayers-Users] help with geolocation/jquery/modernizr script: uncaught type error.

Eric Lemoine eric.lemoine at camptocamp.com
Sun Jun 5 17:09:56 EDT 2011


> var markers = new OpenLayers.Layer.Markers("Markers");var map = new OpenLayers.Map('map');function initGIS(){map.addControl(new OpenLayers.Control.LayerSwitcher());
> var mapnik = new OpenLayers.Layer.OSM();map.addLayer(mapnik);	map.setCenter(new OpenLayers.LonLat(-90, 38).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject()),12);
> }
> jQuery(window).ready(function(){jQuery("#btnInit").click(getLoc);});function getLoc(){if (Modernizr.geolocation) { navigator.geolocation.getCurrentPosition(showMap,handle_error);
> } else {yqlgeo.get('visitor',norm_yql_resp);}}
>
> function showMap(position){//alert('Lat: ' + position.coords.latitude + ' ' + 'Lon: ' + position.coords.longitude + ' ' + 'Acc: ' + position.coords.accuracy);
> var lonlat = new OpenLayers.LonLat(position.coords.longitude,position.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject);

map.getProjectionObject -> map.getProjectionObject()

no?

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list