<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Inside my new function “myZoomTo” is there a way I can highlight that specific area I am zooming to.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">My plan was to use runtime substitution and filter my map file to only highlight a specific one. But Im not sure where I can append to the url before it makes
the request.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Scott<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Geomoose-users [mailto:geomoose-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Jim Klassen<br>
<b>Sent:</b> Wednesday, November 28, 2018 12:55 PM<br>
<b>To:</b> Reynolds, Michael J. (MNIT)<br>
<b>Cc:</b> GeoMOOSE Users List<br>
<b>Subject:</b> Re: [Geomoose-users] Geomoose 3 onclick action<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">It looks like app.zoomToExtent() takes an extent and projection and app.zoomTo() takes a point (in lat/lon), and zoom level, but no projection. This seems like it might be a bit on an oversight, but in the
meantime gm3.util.projectFeatures() is available from services. Paring that with app.zoomTo(point, zoom_level) looks like it would work.<br>
<br>
You could do this in the template directly or add a helper function in your app.js.<br>
<br>
Say something like (untested):<br>
<br>
function myZoomTo(in_point, projection, zoom) {<br>
var point = gm3.util.projectFeatures([point], projection, 'EPSG:4326')[0];<br>
return app.zoomTo(point, zoom);<br>
}<br>
<br>
<br>
then call it from the template as:<br>
<br>
myZoomTo({geometry.coordinates: [x, y]}, 'EPSG:26915', 16);<br>
<br>
I'm not sure that using the global space for myZoomTo is best practice, but just an idea to get started.<br>
<br>
I am also remembering something now about the search templates being able to reproject points, but it looks like that is using properties.boundedBy and app.zoomToExtent, so that might not apply.<br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 11/28/2018 11:18 AM, Reynolds, Michael J. (MNIT) wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The onClick would be in a search template used for rendering search results. Once rendered and displayed to the user, the user could click the <a> and the
onClick would execute the function to zoom to the location.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><div class="search-result"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> <div class="search-label"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> {{ properties.name }} </div></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> <div class="search-action"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> <div style="padding: 2px"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> <a onclick='app.zoomToCoordinates([{{ geometry.coordinates.0 }},{{ geometry.coordinates.1 }}], 26915, 16)' class="zoomto-link"></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> <i class="fa fa-search"></i>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> Zoom!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </div></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </div></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"></div></span><o:p></o:p></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></a><o:p></o:p></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> James Klassen [<a href="mailto:klassen.js@gmail.com">mailto:klassen.js@gmail.com</a>]
<br>
<b>Sent:</b> Wednesday, November 28, 2018 10:44 AM<br>
<b>To:</b> Reynolds, Michael J. (MNIT) <a href="mailto:mike.reynolds@state.mn.us">
<mike.reynolds@state.mn.us></a><br>
<b>Cc:</b> GeoMOOSE Users List <a href="mailto:geomoose-users@lists.osgeo.org"><geomoose-users@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [Geomoose-users] Geomoose 3 onclick action</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">I'm lost. Where is the onClick coming from (DOM element, general description, ...)?<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I know you can create a service that asks the user to click a point on the map and returns the coordinate, etc. You can call the app.* from the HTML returned by the service rendering template (and maybe even earlier) without worrying about
react/dispatch/etc.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I am working on a jump to USNG coordinate service in a branch on my fork (klassenjs/gm3) that does both of the above.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">On Tue, Nov 27, 2018, 06:39 Reynolds, Michael J. (MNIT) <<a href="mailto:mike.reynolds@state.mn.us">mike.reynolds@state.mn.us</a> wrote:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">We're trying to create an onClick() event that passes coordinates, srid, and zoom level in and moves the map to that location.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It seems like the onClick event would need to create an action loaded with the parameters, register and then dispatch or run it, so would that be a function we create in our app's
app.js? <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Plus we would then need to create the zoom action which we would like to transform the coordinates from in-srid to web Mercator and then move the map. Are Proj and mapActions available
to actions at runtime? <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">onClick => app.zoomToCoordinates() => dispatch ZoomToCoordinates action to transform coordinates and move map.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">There's a gm3 zoomTo() function now but it expects lat,lon. We're not currently modifying any of the core geomoose 3 code and hoping to be able to add this modification to our
app's part of the code.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Open to any ideas, even scrapping this procedure with a shorter one if there's a way to control the map without dispatching an action but that would mean the js function somehow
needs access to the app Proj library and map object. Right?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="color:#003865;letter-spacing:.3pt">Michael Reynolds</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Geomoose-users mailing list<br>
<a href="mailto:Geomoose-users@lists.osgeo.org" target="_blank">Geomoose-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geomoose-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/geomoose-users</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>