On Wed, Nov 25, 2009 at 10:39 AM, Louis Nel <nel.lo...@gmail.com> wrote:

> thank you frank, can you please use this code below in a complete asp file,
> because i don't know where to use it in my code or if you can, you can
> modify my code with your code? i will attach you the file.
>
> thank you
>
>
> On Wed, Nov 25, 2009 at 9:57 AM, Franck Grenier <
> franck.gren...@openwide.fr> wrote:
>
>>  No the geocoding is made before and lat & long are sent through my xml.
>> Could it be a map loading issue ? The addOverlay function would try to add
>> markers on a non-completely loaded map ?
>>
>> Here is my code :
>>
>> $(document).ready(function () {
>>     if (GBrowserIsCompatible()) {
>>         var markerGroups = [];
>>         var pictosFleuveRhone = [];
>>
>>         var center = new GLatLng(44.824708282300236, 5.25146484375);
>>         var zoom_level = 8;
>>
>>         var map = new GMap2(document.getElementById("map_canvas"));
>>         map.addMapType(G_PHYSICAL_MAP);
>>         map.setCenter(center, zoom_level, G_PHYSICAL_MAP);
>>
>>         var customUI = map.getDefaultUI();
>>         customUI.zoom.scrollwheel = true;
>>         map.setUI(customUI);
>>
>>         GDownloadUrl("/gmapdata/list/245/listCategories/categories",
>> function(data){
>>             var xml = GXml.parse(data);
>>             var categories =
>> xml.documentElement.getElementsByTagName("categorie");
>>
>>             for (var i = 0; i < categories.length; i++) {
>>                 var cat_id=categories[i].getAttribute("id");
>>                 markerGroups[cat_id] = [];
>>                 $("a#"+cat_id).click(toggleGroup);
>>
>>                 pictosFleuveRhone[cat_id] = new GIcon();
>>                 pictosFleuveRhone[cat_id].image =
>> categories[i].getAttribute("picto");
>>                 pictosFleuveRhone[cat_id].iconSize = new GSize(20, 20);
>>                 pictosFleuveRhone[cat_id].iconAnchor = new GPoint(16, 16);
>>                 pictosFleuveRhone[cat_id].infoWindowAnchor = new GPoint(5,
>> 1);
>>                 pictosFleuveRhone[cat_id].shadow = '';
>>                 pictosFleuveRhone[cat_id].shadowSize = new GSize(22, 20);
>>
>>             }
>>         });
>>
>>         GDownloadUrl("/gmapdata/list/197/listLocation/mapitem",
>> function(data){
>>             var xml = GXml.parse(data);
>>             var markers =
>> xml.documentElement.getElementsByTagName("marker");
>>             for (var i = 0; i < markers.length; i++) {
>>                 var name = markers[i].getAttribute("name");
>>                 var detail = markers[i].getAttribute("detail");
>>                 var label = i;
>>                 var type = markers[i].getAttribute("type_id");
>>                 var point = new
>> GLatLng(parseFloat(markers[i].getAttribute("lat")),
>> parseFloat(markers[i].getAttribute("lng")));
>>                 var marker = createMarker(point, name, label, type,
>> detail);
>>                 map.addOverlay(marker);
>>             }
>>         });
>>
>>         function createMarker(point, name, label, type, detail) {
>>
>>             var marker = new LabeledMarker(point, {icon:
>> pictosFleuveRhone[type]});
>>             markerGroups[type].push(marker);
>>             var html = "<strong>" + name + "</strong> <br/>"+detail;
>>             GEvent.addListener(marker, 'click', function() {
>>                 marker.openInfoWindowHtml(html);
>>             });
>>             return marker;
>>         }
>>
>>         function showMapCenter() {
>>             var center = map.getCenter();
>>             alert(center.toString());
>>         }
>>
>>         function toggleGroup() {
>>             var btn=$(this);
>>             var type=btn.attr('id');
>>             var css_class=btn.attr('class');
>>
>>             if (css_class == 'actif') {
>>                 btn.removeAttr('class');
>>             } else {
>>                 btn.addClass('actif');
>>             }
>>
>>             for (var i = 0; i < markerGroups[type].length; i++) {
>>                 var marker = markerGroups[type][i];
>>                 if (marker.isHidden()) {
>>                     marker.show();
>>                 } else {
>>                     marker.hide();
>>                 }
>>             }
>>         }
>>     }
>> });
>>
>>
>>
>> Mike Williams wrote:
>>
>> Are you perhaps attempting to re-geocode the locations every time
>> someone opens the page? If so, just stop doing that. Store the lat/lng
>> information in the XML.
>>
>> If that's not what you're doing, post a link to a page that exhibits the
>> problem.
>>
>>
>>
>>
>>
>> --
>> Cordialement,
>>
>>   [image: Open Wide logo] <http://www.openwide.fr>     *Franck Grenier*  
>> Développeur
>> Web  TMA     *Open Wide (Lyon)*  97, rue Racine
>> 69100 LYON-VILLEURBANNE   franck.gren...@openwide.fr
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Maps API" group.
>> To post to this group, send email to google-maps-...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-maps-api+unsubscr...@googlegroups.com<google-maps-api%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-maps-api?hl=en.
>>
>
>
>
> --
> Louis Nel
> Sel +27828153273
> Fax:  +27 866 104 812
>



-- 
Louis Nel
Sel +27828153273
Fax:  +27 866 104 812

--

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


<<icoOpenWide.gif>>

Reply via email to