Is this Google Maps API JavaScript really that bad? -
this code google maps api; works fine, says has lot of errors. runs fine.
i have embedded in html file , css stylesheet , works how want, displaying 700+ errors , don't know do. side note if knows how go adding multiple markers please let me know!
var map; var uconn = new google.maps.latlng(41.8057, -72.2494); var my_maptype_id = 'uconn_style' function initialize() { var featureopts = [ { stylers: [ {color: 'rgba(255, 255, 255, 0.17)' }, {visibility: 'simplified' }, {weight: 0.5 }] }, { elementtype: 'labels', stylers: [ {visibility: 'on' }] }, { featuretype: 'road', elementtype: 'geometry', stylers: [ {color: '#000000'}, {weight: 1.0}] }, { scalecontrolstyle: 'top_center', }, { featuretype: 'road', elementtype: 'labels', stylers: [ {color: '#7e1111' }], }, { featuretype: 'landscape', elementtype: 'geometry', stylers: [ {color: 'rgb(63, 204, 51)' }] }, ]; var mapcanvas = document.getelementbyid('map-canvas'); var mapoptions = { center: uconn, zoom: 14, minzoom: 13, scrollwheel: false, maptypecontroloptions: { maptypeids: [google.maps.maptypeid.roadmap, my_maptype_id]}, maptypeid: my_maptype_id}; map = new google.maps.map(document.getelementbyid('map-canvas'),mapoptions); var styledmapoptions = { name: 'custom style'}; var custommaptype = new google.maps.styledmaptype(featureopts, styledmapoptions); map.maptypes.set(my_maptype_id, custommaptype); var worldcoords = [ new google.maps.latlng(-85.1054596961173, 0), new google.maps.latlng(-85.1054596961173, 180), new google.maps.latlng(85.1054596961173, 180), new google.maps.latlng(85.1054596961173, -180), new google.maps.latlng(-85.1054596961173, -180),] var uconncoordinates = [ new google.maps.latlng(41.827428,-72.266607), new google.maps.latlng(41.818601,-72.255278), new google.maps.latlng(41.817322,-72.254848), new google.maps.latlng(41.820648,-72.248411), new google.maps.latlng(41.820968,-72.247038), new google.maps.latlng(41.815914,-72.242575), new google.maps.latlng(41.813867,-72.243347), new google.maps.latlng(41.810797,-72.249012), new google.maps.latlng(41.810669,-72.246351), new google.maps.latlng(41.810029,-72.244291), new google.maps.latlng(41.810797,-72.239914), new google.maps.latlng(41.812204,-72.236309), new google.maps.latlng(41.811884,-72.232189), new google.maps.latlng(41.811244,-72.230558), new google.maps.latlng(41.809709,-72.230043), new google.maps.latlng(41.807598,-72.230988), new google.maps.latlng(41.805806,-72.229958), new google.maps.latlng(41.802223,-72.225065), new google.maps.latlng(41.802543,-72.223520), new google.maps.latlng(41.801136,-72.221289), new google.maps.latlng(41.798256,-72.219658), new google.maps.latlng(41.796849,-72.217340), new google.maps.latlng(41.792689,-72.221289), new google.maps.latlng(41.791985,-72.223263), new google.maps.latlng(41.789362,-72.227640), new google.maps.latlng(41.794033,-72.235365), new google.maps.latlng(41.794865,-72.236309), new google.maps.latlng(41.790258,-72.240772), new google.maps.latlng(41.788978,-72.244205), new google.maps.latlng(41.789874,-72.247295), new google.maps.latlng(41.788146,-72.247210), new google.maps.latlng(41.784306,-72.260942), new google.maps.latlng(41.787890,-72.260513), new google.maps.latlng(41.792113,-72.263689), new google.maps.latlng(41.786418,-72.276649), new google.maps.latlng(41.790642,-72.279654), new google.maps.latlng(41.798640,-72.274761), new google.maps.latlng(41.801712,-72.276821), new google.maps.latlng(41.802927,-72.280684), new google.maps.latlng(41.804207,-72.279310), new google.maps.latlng(41.810733,-72.284632), new google.maps.latlng(41.815914,-72.279482), new google.maps.latlng(41.816938,-72.283173), new google.maps.latlng(41.822631,-72.278795), new google.maps.latlng(41.823974,-72.273903), new google.maps.latlng(41.825893,-72.270384), new google.maps.latlng(41.827417,-72.266621)]; var poly = new google.maps.polygon({ paths: [worldcoords, uconncoordinates], strokecolor: '#000fc4', strokeopacity: 1, strokeweight: 4, fillcolor: '#000000', fillopacity: .75}); poly.setmap(map); } google.maps.event.adddomlistener(window, 'load', initialize);
Comments
Post a Comment