Google Maps GroundOverlay - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

I am attempting to get a Google maps GroundOverlay working without luck. Searched everywhere, read the Google reference documentation, ... Resultsfromthe2022DeveloperSurveyarehere. Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore GoogleMapsGroundOverlay AskQuestion Asked 6years,10monthsago Modified 6years,10monthsago Viewed 3ktimes 0 IamattemptingtogetaGooglemapsGroundOverlayworkingwithoutluck.Searchedeverywhere,readtheGooglereferencedocumentation,stillnolucK. WhatIhaveattemptedcanbeseenat: http://www.ryecemetery.com.au/locate.html Verybasiccode:

Test Youcanseethatsomesortofoverlayisplacedonthemap.IbelieveIhavethesw,nelatlngcorrect.IfIcheckonGooglemapsbyrightclickingandchoosing"whatshere"thosearethelatlngthatisgiven. Ihavetheoverlayinpng,gifandjpeg.WiththepngandgifIgetnothingtoappear. WherehaveIgonewrong? thanks Ken google-mapsgoogle-maps-api-3 Share Follow askedAug20,2015at12:19 KenKen 2711silverbadge88bronzebadges Addacomment  |  1Answer 1 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 0 YourboundsiswrongforyourgroundOverlay. accordingtothedocumentationfortheconstructorforagoogle.maps.LatLngBoundsobject: Constructor LatLngBounds(sw?:LatLng,ne?:LatLng)Constructsarectanglefromthepointsatitssouth-westandnorth-eastcorners. TheargumentsshouldbeSW,NE.YourargumentsareSE,NW.Yourcode: varimageBounds=newgoogle.maps.LatLngBounds( newgoogle.maps.LatLng(-38.374615,144.823766),//SE newgoogle.maps.LatLng(-38.373628,144.821631)//NW ); IfIswapthelongitudesbetweenthetwopointsitworks: varimageBounds=newgoogle.maps.LatLngBounds( newgoogle.maps.LatLng(-38.374615,144.821631),//SW newgoogle.maps.LatLng(-38.373628,144.823766)//NE ); proofofconceptfiddle codesnippet: varhistoricalOverlay; varmyLatlng=newgoogle.maps.LatLng(-38.374058,144.822763); varmap=newgoogle.maps.Map(document.getElementById('map-canvas'),{ zoom:18, center:myLatlng }); varmarkerNW=newgoogle.maps.Marker({ position:newgoogle.maps.LatLng(-38.374615,144.823766), map:map, icon:{ url:"https://maps.gstatic.com/intl/en_us/mapfiles/markers2/measle.png", size:newgoogle.maps.Size(7,7), anchor:newgoogle.maps.Point(3.5,3.5) }, title:"SW" }); varmarkerSE=newgoogle.maps.Marker({ position:newgoogle.maps.LatLng(-38.373628,144.821631), map:map, icon:{ url:"https://maps.gstatic.com/intl/en_us/mapfiles/markers2/measle_blue.png", size:newgoogle.maps.Size(7,7), anchor:newgoogle.maps.Point(3.5,3.5) }, title:"NE" }); varimageBounds=newgoogle.maps.LatLngBounds( newgoogle.maps.LatLng(-38.374615,144.821631), newgoogle.maps.LatLng(-38.373628,144.823766)); historicalOverlay=newgoogle.maps.GroundOverlay( 'http://www.ryecemetery.com.au/images/layout-06a.jpg', imageBounds); historicalOverlay.setMap(map); html, body, #map-canvas{ height:100%; width:100%; margin:0px; padding:0px } Share Follow editedAug20,2015at14:13 MrUpsidown 20.7k1212goldbadges6969silverbadges123123bronzebadges answeredAug20,2015at14:04 geocodezipgeocodezip 154k1313goldbadges208208silverbadges238238bronzebadges 2 @MrUpsidownthanksfortheanswer,ItworkedperfectlyonceIgottherightco-ords,somehowhadNW,SEstuckinmyhead:-(AsampleofaworkingpageisattheoriginalURLifinterested.SorryIhavenotreplieduntilnowbutIhavebeenquiteillsincepostingquestionuntiltoday. – Ken Aug27,2015at6:48 [email protected];-) – MrUpsidown Aug27,2015at8:13 Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedgoogle-mapsgoogle-maps-api-3oraskyourownquestion. TheOverflowBlog ExpertsfromStripeandWaymoexplainhowtocraftgreatdocumentation(Ep.455) Askedandanswered:theresultsforthe2022Developersurveyarehere! FeaturedonMeta AnnouncingthearrivalofValuedAssociate#1214:Dalmarus Testingnewtrafficmanagementtool AskWizardTestResultsandNextSteps Trending:Anewanswersortingoption Linked 1 AngularGroundoverlay Related 2 GoogleMapsStoppedworkingsuddenly(BlankMap) 441 GoogleMapsAPIv3:Howtoremoveallmarkers? 569 HowtodisablemousescrollwheelscalingwithGoogleMapsAPI 706 GoogleMapsJSAPIv3-SimpleMultipleMarkerExample 2 Redrawingmapbasedonlatandlonggooglemap 2 googlemapsrefreshinggrey 0 googlemapapiwithoutrefresh 3 GoogleMapsinitMapaddparameterstofunction HotNetworkQuestions WeknowClassicalMechanicsiswrong.ButcanwealsosayeveryothertheoryiswrongexcepttheTheoryofEverything? Isthereanysignificantdifferencebetween駆け回るand駆け巡る? Whyusedecltypeonatemplateargument? Extendingsignalduration Arechemicalsusedtoripenfruitindevelopingcountriesharmfultothehealthofconsumers? Running15ampsthrougha10ampswitchtopowera13ampcircuit? TryingtoidentifysomethingIsawinthesky Whydoes“revocable”havefirst-syllablestress? HowdoIconveythatIambadatrememberingthings? PCBEthernetinstability-CM4BreakoutBoard HowdosmalllocalMalayrestaurantsinnon-touristyareasinMalaysiawork? TowhatextentareEnglandandWalesonecompletelyweddedjurisdiction? Howtallarethemushrooms? DC/DCConverternotoutputtingthecorrectvoltage Whatarebestpracticesfortestingtheabsenceoffunctionality Whatdoyoucallthepointypartsofatextbubblethat'snotthetail? Auto-Launchappfromthedmg Kakeyacrossed-needlesproblem Doestheuseoffrontsuspensionnegativelyaffectroadridingefficiency? CanIasktobeconsideredforanotheropeninginsamegroup? WouldpubliclyfartingonapictureoftheEnglishmonarchactuallyqualifyastreasonin1798? WhatisthepurposeofthefuelpumpsintheA320? Whatdoes"ifinlocation"contextmeaninNginx? Whywouldaparticularheatpumpmodelbeillegalinmystate? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  


請為這篇文章評分?