|
| WB18 Google map in HTML control. This should work. |
| Iniciado por guest, 02,dic. 2014 12:10 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 02,diciembre 2014 - 12:10 |
Hi all First, excuse me for all these posts. I guess my problem was that i put html and java code in the message. This did not Work. Instead I have put all the code in at pdf which I have attached. Moderators: You are welcome to delete previous messages with the same topic.
Now for the topic:
I am working on implementing Google maps api V3 via a HTML control. It Works, well almost. I can show maps, zoom, etc. But I have problems putting needles on the map (markers). Standard markers Work fine, but markers based on a PNG file does not Work.
In a Dynamic AWP site this Works fine. All the time. In a Dynamic webdev site it does not Work. Never. Guess what I need to Work with 
It seems like the HTML control simply cannot find the PNG file. If I hover the mouse over the place where the marker should be, the cursor changes and the title are shown, so the marker Works, just without showing itself. I have placed the PNG file everywhere with no luck (
Now for the code. If you put this in a HTML control it should Work. The api key being used are one from this site: http://www.w3schools.com/googleAPI/google_maps_basic.asp . You should use your own.
Doc of Javascript: https://developers.google.com/maps/documentation/javascript/markers… Tutorial: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://www.w3schools.com/googleAPI/google_maps_basic.asp">http://www.w3schools.com/googleAPI/google_maps_basic.asp</a>
Any help to get this working with a Dynamic webdev site are most welcome. Best regards Viggo Poulsen
Two attachments: The code, and a PNG to test with:
[attachment 1259 code.pdf]
[attachment 1260 2.png] |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,diciembre 2014 - 12:25 |
Hi Viggo
logically, I would replace your icon: '2.png' by something like this: icon: '<a class="ExternalLink" rel="nofollow" target="_blank" href="http://mysite/MyIconDirectory/2.png"> <img src="http://mysite/MyIconDirectory/2.png" border="0" class="ExternalImage" onerror="OnImageLoadFailure(this);"/> </a>' so that the name is absolute and doesn't care about awp<>classic or anything else webdev related
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,diciembre 2014 - 16:31 |
Hi Fabrice
Yes, you are right. Now I use this:
sIconPath is string = SiteAddress()+"_Web/MyIcon/" sIcon = sIconPath + "1.png"
In my Map code I have this: var marker=new google.maps.Marker({ Position: new google.maps.LatLng( %1, %2 ), title:" %3 ", icon: '%4'
And I finally put in some data like this: StringBuild(sMapMarker,rMarkLat,rMarkLon,sTitle,sIcon)
And it Works fine now.
Best regards Viggo Poulsen |
| |
| |
| | | |
|
| | | | |
| | |
|