Thank you very much for your answer, your exhibit is really nice !
(Unfortunately I cannot show you my exhibit as it is password
protected for the moment due to sensitive data)
I did some modification to my code according to your previous message
as you can see below
<script>
var map;
var oldMapViewReconstruct = Exhibit.MapView.prototype._reconstruct;
Exhibit.MapView.prototype._reconstruct = function() {
oldMapViewReconstruct.call(this);
map = this._map;
circ = new GGeoXml("/circonscriptions/chicago3.kml");
map.addOverlay(circ);
};
function newMapConstructor(mapDiv) {
map = new GMap2(mapDiv);
map.setCenter(new GLatLng(38.788345,-95.273437), 4);
map.addControl(new GLargeMapControl3D());
//map.addControl(new GMenuMapTypeControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.addMapType(G_PHYSICAL_MAP);
map.setMapType(G_NORMAL_MAP);
map.enableScrollWheelZoom();
map.enableContinuousZoom();
//map.addOverlay(new GLayer("com.panoramio.all"));
//map.addOverlay(new GLayer("org.wikipedia.en"));
return map;
}
</script>
But the KML overlay still does not appear on the map. While this KML
file is displayed fine when I load it in a html file :
http://www.france-science.org/map/map3.html. So I guess the KML file
is ok.
Any idea of what I could have done wrong ?
On Nov 1, 7:51 pm, John Callahan <[email protected]> wrote:
> Try loading an XML/KML from your local web server instead of remotely.
>
> Also, to make the overlay permanent, I don't think using the mapConstructor
> function will work. IIRC, these overlays get removed (and not added back)
> while you're in the map view when facets get selected (or deselected.) Use
> Exhibit.MapView.prototype._reconstruct
>
> Here is an
> example:http://www.dgs.udel.edu/projects/delaware-offshore-geologic-inventory...
> (I do use mapConstructor here as well but only for map controls and
> location.)
>
> - John
>
> **************************************************
> John Callahan, Research Scientist
> Delaware Geological Survey, University of Delaware
> URL:http://www.dgs.udel.edu
> **************************************************
>
> On Mon, Nov 1, 2010 at 5:41 PM, Frederic_L <[email protected]>wrote:
>
>
>
> > Hi,
>
> > I built an Exhibit with this new map constructor below and it's
> > working fine. But I would like to add Overlays from several KML files
> > I have. I would like these overlays to be permanent and not in the
> > dataset I load with Exhibit. So I tried to add an overlay in the new
> > map constructor < map.addOverlay(new GGeoXml("http://www.france-
> > science.org/map/chicago3.kml"));>, but it does not work (I tested to
> > add the KML as an overlay in another file without Exhibit and it's
> > working).
>
> > By the way, the addOverlay of Wikipedia or panomario is working.
>
> > Do you have an idea of what could be wrong ?
>
> > Thank you very much !
>
> > <script>
> > var newMapConstructor = function(mapDiv) {
> > var map;
> > map = new GMap2(mapDiv);
> > map.setCenter(new GLatLng(38.788345,-95.273437), 4);
> > map.addControl(new GLargeMapControl3D());
> > //map.addControl(new GMenuMapTypeControl());
> > map.addControl(new GMapTypeControl());
> > map.addControl(new GScaleControl());
> > map.addMapType(G_PHYSICAL_MAP);
> > map.setMapType(G_NORMAL_MAP);
> > map.enableScrollWheelZoom();
> > map.enableContinuousZoom();
> > map.addOverlay(new GGeoXml("http://www.france-science.org/map/
> > chicago3.kml"));
> > //map.addOverlay(new GLayer("com.panoramio.all"));
> > //map.addOverlay(new GLayer("org.wikipedia.en"));
> > return map;
> > }
> > </script>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "SIMILE Widgets" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<simile-widgets%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/simile-widgets?hl=en.
--
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en.