[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapguide-users
Subject:    [mapguide-users] Fwd:  download kml and upload kml in fusion
From:       Hadis Alinia <hadissaalinia () gmail ! com>
Date:       2022-05-30 13:32:52
Message-ID: CAAt6ho2FTtxH_XgJ8BLVJd3vHFJJUM5s+R52wndTKcn2qS0vVg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Does anyone have any idea why I can't see my kml file? Do you have any
sample code that works for you?

---------- Forwarded message ---------
From: Hadis Alinia <hadissaalinia@gmail.com>
Date: Thu, May 26, 2022 at 9:27 AM
Subject: Re: [mapguide-users] download kml and upload kml in fusion
To: MapGuide Users Mail List <mapguide-users@lists.osgeo.org>


Hi Gordon,

I am trying to script to upload a kml from local folder to my map. (I want
the user to select the file from their local folder and be able to overlay
(temporary) on the other exiting maps)
I placed a kml sample into my template folder and added a script to task
pane as follows : I don't receive any error, but I can't see my map. I am
not sure what is the issue?


var source = new Proj4js.Proj('EPSG:4326');
Proj4js.defs["EPSG:3857"]="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
var dest = new Proj4js.Proj('EPSG:3857');

var geocoder = new google.maps.Geocoder();

function display_kmlmap()
{

var map = parent.Fusion.getWidgetById('Map');
var olMap = map.oMapOL;


var kmlmap = new parent.OpenLayers.Layer.vector("KML", "KML/sample.kml", {
   format: parent.OpenLayers.Format.KML,
   projection:  new parent.OpenLayers.Projection('EPSG:3857'),
   formatOptions: {
       'extractStyles': true,
   'extractAttributes': true
   },
   visible: true
});

olMap.addLayers(kmlmap);

<body onload="display_kmlmap()">


    <div id="map" class="smallmap"></div>

</body>



On Wed, May 18, 2022 at 11:48 AM Gordon Luckett <
gordon.luckett@arrowgeomatics.com> wrote:

> Ajax (Basic Web Layout) does not support KML - the Fusion (Flexible Web
> Layout/Web Application) uses OpenLayers 2.13 and this does support KML
> parsing etc.
>
>
>
>
>
> On Tue, May 17, 2022 at 7:07 PM Hadis Alinia <hadissaalinia@gmail.com>
> wrote:
>
>> Hi,
>>
>> I need to enable the user of my webmap application built by Mapguide to
>> overlay their kml layers in ajax view or convert CSVs with lat and lon to a
>> point data and then can download their points data as kml. Or select a
>> feature of the uploaded layer and download it as a kml. Is that even
>> possible in mapguide? I can't find an example searching on google.
>> Please advise
>>
>> Thank you
>> HA
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapguide-users
>

[Attachment #5 (text/html)]

<div dir="ltr">Does anyone have any idea why I can&#39;t see my kml file? Do you have \
any sample code that works for you?  <br><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">---------- Forwarded message ---------<br>From: <strong \
class="gmail_sendername" dir="auto">Hadis Alinia</strong> <span dir="auto">&lt;<a \
href="mailto:hadissaalinia@gmail.com">hadissaalinia@gmail.com</a>&gt;</span><br>Date: \
Thu, May 26, 2022 at 9:27 AM<br>Subject: Re: [mapguide-users] download kml and upload \
kml in fusion<br>To: MapGuide Users Mail List &lt;<a \
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>&gt;<br></div><br><br><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Gordon,  \
<div><br></div><div>I am trying to script to  upload a kml from local folder to my \
map. (I want the user to select the file from their local folder and be able to \
overlay (temporary) on the other exiting maps)</div><div>I placed a kml sample into \
my template folder and added a script to task pane as follows : I don&#39;t receive \
any error, but I can&#39;t  see my map. I am not sure what is the \
issue?</div><div><br></div><div>  </div><div><div>var source = new \
Proj4js.Proj(&#39;EPSG:4326&#39;);  \
</div><div>Proj4js.defs[&quot;EPSG:3857&quot;]=&quot;+proj=merc +a=6378137 +b=6378137 \
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null \
+no_defs&quot;</div><div>var dest = new \
Proj4js.Proj(&#39;EPSG:3857&#39;);</div><div><br></div><div>var geocoder = new \
google.maps.Geocoder();</div><div><br></div><div>function \
display_kmlmap()</div><div>{</div><div><br></div><div>var map = \
parent.Fusion.getWidgetById(&#39;Map&#39;);</div><div>var olMap = \
map.oMapOL;</div><div><br></div><div>                   </div><div>var kmlmap = new \
parent.OpenLayers.Layer.vector(&quot;KML&quot;, &quot;KML/sample.kml&quot;, \
{</div><div>     format: parent.OpenLayers.Format.KML,</div><div>     projection:   \
new parent.OpenLayers.Projection(&#39;EPSG:3857&#39;),</div><div>     formatOptions: \
{</div><div>           &#39;extractStyles&#39;: true,</div><div><span \
style="white-space:pre-wrap">	</span>     &#39;extractAttributes&#39;: \
true</div><div>     },  </div><div>     visible: true</div><div>});<span \
style="white-space:pre-wrap">	</span></div></div><div><br></div><div>olMap.addLayers(kmlmap);<br></div><div><br></div><div><div>&lt;body \
onload=&quot;display_kmlmap()&quot;&gt;</div><div><br></div><div>    </div><div>      \
&lt;div id=&quot;map&quot; \
class=&quot;smallmap&quot;&gt;&lt;/div&gt;</div><div><br></div><div>&lt;/body&gt;</div></div><div><br></div><div><br></div></div></div></div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 18, 2022 at 11:48 \
AM Gordon Luckett &lt;<a href="mailto:gordon.luckett@arrowgeomatics.com" \
target="_blank">gordon.luckett@arrowgeomatics.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Ajax (Basic Web Layout) does not \
support KML - the Fusion (Flexible Web Layout/Web Application) uses OpenLayers 2.13 \
and this does support KML parsing \
etc.<div><br></div><div><br><div><br></div><div><br></div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 17, 2022 at 7:07 PM \
Hadis Alinia &lt;<a href="mailto:hadissaalinia@gmail.com" \
target="_blank">hadissaalinia@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,  <div><br></div><div>I need to \
enable the user of my webmap  application built by Mapguide to overlay their kml \
layers in ajax view or convert CSVs with lat and lon to a point data and then can \
download their  points data as kml. Or select a feature of the uploaded layer and \
download  it as a kml. Is that even possible in mapguide? I can&#39;t find an example \
searching on google.</div><div>Please  advise</div><div><br></div><div>Thank \
you</div><div>HA</div></div> _______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" \
target="_blank">mapguide-users@lists.osgeo.org</a><br> <a \
href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br> \
</blockquote></div> _______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" \
target="_blank">mapguide-users@lists.osgeo.org</a><br> <a \
href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br> \
</blockquote></div> </div></div>



_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic