<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
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>
<br>
<div class="moz-cite-prefix">On 11/28/2018 11:18 AM, Reynolds,
Michael J. (MNIT) wrote:<br>
</div>
<blockquote type="cite"
cite="mid:DM2PR09MB0256CB0574E317B78A87DCCFB8D10@DM2PR09MB0256.namprd09.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 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;}
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-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@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]-->
<div class="WordSection1">
<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.<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"><div
class="search-result"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
<div class="search-label"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
{{ properties.name }} </div><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
<div class="search-action"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
<div style="padding: 2px"><o:p></o:p></span></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"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
<i class="fa fa-search"></i>
<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
Zoom!<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
</a><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
</div><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
</div><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"></div><o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"
moz-do-not-send="true"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></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 class="moz-txt-link-freetext" 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 class="moz-txt-link-rfc2396E" href="mailto:mike.reynolds@state.mn.us"><mike.reynolds@state.mn.us></a><br>
<b>Cc:</b> GeoMOOSE Users List
<a class="moz-txt-link-rfc2396E" href="mailto:geomoose-users@lists.osgeo.org"><geomoose-users@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [Geomoose-users] Geomoose 3 onclick
action<o:p></o:p></span></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"
moz-do-not-send="true">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" moz-do-not-send="true">Geomoose-users@lists.osgeo.org</a><br>
<a
href="https://lists.osgeo.org/mailman/listinfo/geomoose-users"
target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/geomoose-users</a><o:p></o:p></p>
</div>
</blockquote>
<br>
</body>
</html>